moved some stuff around and made luxon local
All checks were successful
/ weblog.lol (push) Successful in 13s

This commit is contained in:
Gordon Pedersen 2024-05-13 11:35:17 +10:00
parent c4649e2386
commit 8942d2b4f3
8 changed files with 112 additions and 93 deletions

View file

@ -38,7 +38,6 @@
<hr> <hr>
<h2>Recent posts</h2> <h2>Recent posts</h2>
{recent-posts} {recent-posts}
</main> </main>
@ -47,8 +46,8 @@
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p> <p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer> </footer>
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script> <script src="/js/luxon.min.js" crossorigin="anonymous"></script>
<script src="/fediverse.js"></script> <script src="/js/fediverse.js"></script>
<script> <script>
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => { document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime')) const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))

1
js/luxon.min.js vendored Symbolic link
View file

@ -0,0 +1 @@
./weblog/B0. Template/luxon.min.js.md

View file

@ -2,7 +2,7 @@
Type: file Type: file
Content-Type: application/javascript Content-Type: application/javascript
Title: Fediverse script Title: Fediverse script
Location: /fediverse.js Location: /js/fediverse.js
/**/ /**/
const SUBSCRIBE_LINK_REL = 'http://ostatus.org/schema/1.0/subscribe' const SUBSCRIBE_LINK_REL = 'http://ostatus.org/schema/1.0/subscribe'

File diff suppressed because one or more lines are too long

View file

@ -14,7 +14,7 @@ Title: Landing Page Template
<div class="header"> <div class="header">
<header> <header>
<img class="avatar" src="https://cdn.some.pics/deathau/663da4619fdb6.svg" alt="My avatar — A pixelated self-portrait in the style of the 'bitizens' in the mobile game Tiny Tower"> <img class="avatar" src="https://cdn.some.pics/deathau/663da4619fdb6.svg" alt="My avatar — A pixelated self-portrait in the style of the 'bitizens' in the mobile game Tiny Tower" />
<h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1> <h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1>
{navigation} {navigation}
<fedi-social></fedi-social> <fedi-social></fedi-social>
@ -36,8 +36,8 @@ Title: Landing Page Template
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p> <p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer> </footer>
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script> <script src="/js/luxon.min.js" crossorigin="anonymous"></script>
<script src="/fediverse.js"></script> <script src="/js/fediverse.js"></script>
<script> <script>
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => { document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime')) const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))

View file

@ -12,22 +12,33 @@ Title: Page Template
</head> </head>
<body> <body>
<div class="header">
<header> <header>
<img class="avatar" src="https://cdn.some.pics/deathau/663da4619fdb6.svg" alt="My avatar — A pixelated self-portrait in the style of the 'bitizens' in the mobile game Tiny Tower" />
<h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1> <h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1>
{navigation} {navigation}
<fedi-social></fedi-social>
</header> </header>
</div>
<main class="page"> <main class="page">
{body} {body}
<hr> <hr>
</main> </main>
<footer> <footer>
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p> <p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer> </footer>
<script src="/js/luxon.min.js" crossorigin="anonymous"></script>
<script src="/js/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()
})
fediverse()
</script>
</body> </body>
</html> </html>