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

@ -9,53 +9,52 @@
</head> </head>
<body> <body>
<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>
</header> </header>
</div> </div>
<main class="weblog"> <main class="weblog">
<article> <article>
<aside class="post-info"> <aside class="post-info">
<a href="{location}"><i class="fa-solid fa-clock"></i> <time class="dt-published" datetime="{date}">{date}</time></a> <a href="{location}"><i class="fa-solid fa-clock"></i> <time class="dt-published" datetime="{date}">{date}</time></a>
</aside> </aside>
<i data-emoji="{emoji}"></i> <i data-emoji="{emoji}"></i>
{body} {body}
<aside class="post-info"> <aside class="post-info">
<a class="status_url" href="{status_url}" target="_blank"><i class="omg-icon omg-prami"></i> via status.lol</a> <a class="status_url" href="{status_url}" target="_blank"><i class="omg-icon omg-prami"></i> via status.lol</a>
<a class="external_url" href="{external_url}" target="_blank"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a> <a class="external_url" href="{external_url}" target="_blank"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a>
</aside> </aside>
<aside class="post-tags"> <aside class="post-tags">
{tags} {tags}
</aside> </aside>
</article> </article>
<hr> <hr>
<h2>Recent posts</h2> <h2>Recent posts</h2>
{recent-posts}
{recent-posts} </main>
</main> <footer>
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer>
<footer> <script src="/js/luxon.min.js" crossorigin="anonymous"></script>
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p> <script src="/js/fediverse.js"></script>
</footer> <script>
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
<script src="https://cdn.jsdelivr.net/npm/luxon/build/global/luxon.min.js" crossorigin="anonymous"></script> const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
<script src="/fediverse.js"></script> time.innerText = datetime.toRelative()
<script> });
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => { fediverse()
const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime')) </script>
time.innerText = datetime.toRelative()
});
fediverse()
</script>
</body> </body>
</html> </html>

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

@ -12,39 +12,39 @@ Title: Landing Page Template
</head> </head>
<body> <body>
<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>
</header> </header>
</div> </div>
<main class="landing"> <main class="landing">
{body} {body}
<nav> <nav>
{next-page} {next-page}
{previous-page} {previous-page}
</nav> </nav>
</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="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'))
time.innerText = datetime.toRelative() time.innerText = datetime.toRelative()
}) })
fediverse() fediverse()
</script> </script>
</body> </body>
</html> </html>

View file

@ -12,22 +12,33 @@ Title: Page Template
</head> </head>
<body> <body>
<header> <div class="header">
<h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1> <header>
{navigation} <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" />
</header> <h1 class="weblog-title"><a href="{base-path}">{weblog-title}</a></h1>
{navigation}
<fedi-social></fedi-social>
</header>
</div>
<main class="page"> <main class="page">
{body}
<hr>
</main>
{body} <footer>
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p>
</footer>
<hr> <script src="/js/luxon.min.js" crossorigin="anonymous"></script>
<script src="/js/fediverse.js"></script>
</main> <script>
document.querySelectorAll('time:not(.dt-start):not(.dt-end)').forEach(time => {
<footer> const datetime = luxon.DateTime.fromISO(time.getAttribute('datetime'))
<p>Made with <a href="https://weblog.lol">weblog.lol</a>.</p> time.innerText = datetime.toRelative()
</footer> })
fediverse()
</script>
</body> </body>
</html> </html>

View file

@ -2,16 +2,16 @@ Type: Template
Title: Post Template Title: Post Template
<article> <article>
<aside class="post-info"> <aside class="post-info">
<a href="{location}"><i class="fa-solid fa-clock"></i> <time class="dt-published" datetime="{date}">{date}</time></a> <a href="{location}"><i class="fa-solid fa-clock"></i> <time class="dt-published" datetime="{date}">{date}</time></a>
</aside> </aside>
<i data-emoji="{emoji}"></i> <i data-emoji="{emoji}"></i>
{body} {body}
<aside class="post-info"> <aside class="post-info">
<a class="status_url" href="{status_url}" target="_blank"><i class="omg-icon omg-prami"></i> via status.lol</a> <a class="status_url" href="{status_url}" target="_blank"><i class="omg-icon omg-prami"></i> via status.lol</a>
<a class="external_url" href="{external_url}" target="_blank"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a> <a class="external_url" href="{external_url}" target="_blank"><i class="omg-icon omg-fediverse"></i> Interact on the Fediverse</a>
</aside> </aside>
<aside class="post-tags"> <aside class="post-tags">
{tags} {tags}
</aside> </aside>
</article> </article>