This commit is contained in:
parent
535e9451a8
commit
3005376521
4 changed files with 21 additions and 19 deletions
|
@ -25,7 +25,10 @@
|
|||
</aside>
|
||||
<i data-emoji="{emoji}"></i>
|
||||
{body}
|
||||
<aside class="post-info"><a class="status_url" href="{status_url}"><i class="omg-icon omg-prami"></i> via status.lol</a><a class="external_url" href="{external_url}"><i class="omg-icon omg-fediverse"></i> Reply on the Fediverse</a></aside>
|
||||
<aside class="post-info">
|
||||
<a class="status_url" href="{status_url}"><i class="omg-icon omg-prami"></i> via status.lol</a>
|
||||
<a class="external_url" href="{external_url}"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a>
|
||||
</aside>
|
||||
<aside class="post-tags">
|
||||
{tags}
|
||||
</aside>
|
||||
|
@ -44,18 +47,13 @@
|
|||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script>
|
||||
<script src="/share.js"></script>
|
||||
<script src="/fediverse.js"></script>
|
||||
<script>
|
||||
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
|
||||
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
|
||||
time.innerText = datetime.toRelative()
|
||||
});
|
||||
document.querySelectorAll("a.external_url:not([href='{external_url}'])").forEach(el => {
|
||||
el.addEventListener('click', e => {
|
||||
e.preventDefault()
|
||||
share(el.href)
|
||||
})
|
||||
})
|
||||
fediverse()
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*/
|
||||
Type: file
|
||||
Content-Type: application/javascript
|
||||
Title: Share script
|
||||
Location: /share.js
|
||||
Title: Fediverse script
|
||||
Location: /fediverse.js
|
||||
/**/
|
||||
|
||||
const SUBSCRIBE_LINK_REL = 'http://ostatus.org/schema/1.0/subscribe'
|
||||
|
@ -39,4 +39,13 @@ function share(uri, handle) {
|
|||
throw 'Please enter your fediverse address in @user@domain.social format'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fediverse() {
|
||||
document.querySelectorAll("a.external_url:not([href='{external_url}'])").forEach(el => {
|
||||
el.addEventListener('click', e => {
|
||||
e.preventDefault()
|
||||
share(el.href)
|
||||
})
|
||||
})
|
||||
}
|
|
@ -36,18 +36,13 @@ Title: Landing Page Template
|
|||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script>
|
||||
<script src="/share.js"></script>
|
||||
<script src="/fediverse.js"></script>
|
||||
<script>
|
||||
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
|
||||
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
|
||||
time.innerText = datetime.toRelative()
|
||||
});
|
||||
document.querySelectorAll("a.external_url:not([href='{external_url}'])").forEach(el => {
|
||||
el.addEventListener('click', e => {
|
||||
e.preventDefault()
|
||||
share(el.href)
|
||||
})
|
||||
})
|
||||
})
|
||||
fediverse()
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -9,7 +9,7 @@ Title: Post Template
|
|||
{body}
|
||||
<aside class="post-info">
|
||||
<a class="status_url" href="{status_url}"><i class="omg-icon omg-prami"></i> via status.lol</a>
|
||||
<a class="external_url" href="{external_url}"><i class="omg-icon omg-fediverse"></i> Reply on the Fediverse</a>
|
||||
<a class="external_url" href="{external_url}"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a>
|
||||
</aside>
|
||||
<aside class="post-tags">
|
||||
{tags}
|
||||
|
|
Loading…
Reference in a new issue