Reformatting

This commit is contained in:
2024-11-04 23:23:20 +00:00
parent bdcc7cea6a
commit 232599a7f8
18 changed files with 140 additions and 100 deletions

View File

@@ -33,7 +33,9 @@
{# {%- css %}{% include "node_modules/prismjs/themes/prism-okaidia.css" %}{% endcss %} #}
{#- Render the CSS bundle using inlined CSS (for the fastest site performance in production) #}
<style>{% getBundle "css" %}</style>
<style>
{% getBundle "css" %}
</style>
{#- Renders the CSS bundle using a separate file, if you can't set CSP directive style-src: 'unsafe-inline' #}
{#- <link rel="stylesheet" href="{% getBundleFileUrl "css" %}"> #}
@@ -50,9 +52,11 @@
<nav>
<h2 class="visually-hidden">Top level navigation menu</h2>
<ul class="nav">
{%- for entry in collections.all | eleventyNavigation %}
<li class="nav-item"><a href="{{ entry.url }}"{% if entry.url == page.url %} aria-current="page"{% endif %}>{{ entry.title }}</a></li>
{%- endfor %}
{%- for entry in collections.all | eleventyNavigation %}
<li class="nav-item">
<a href="{{ entry.url }}"{% if entry.url == page.url %} aria-current="page"{% endif %}>{{ entry.title }}</a>
</li>
{%- endfor %}
</ul>
</nav>
</header>
@@ -64,10 +68,13 @@
</main>
<footer>
<p><em>Built with <a href="https://www.11ty.dev/">{{ eleventy.generator }}</a></em></p>
<p>
<em>Built with <a href="https://www.11ty.dev/">{{ eleventy.generator }}</a>
</em>
</p>
</footer>
<!-- This page `{{ page.url | htmlBaseUrl }}` was built on {% currentBuildDate %} -->
<script type="module" src="{% getBundleFileUrl "js" %}"></script>
</body>
</html>
</html>

View File

@@ -2,4 +2,4 @@
layout: layouts/base.njk
---
{{ content | safe }}
{{ content | safe }}

View File

@@ -7,22 +7,35 @@ layout: layouts/base.njk
<h1>{{ title }}</h1>
<ul class="post-metadata">
<li><time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time></li>
<li>
<time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time>
</li>
{%- for tag in tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li><a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a>{%- if not loop.last %}, {% endif %}</li>
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li>
<a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a>
{%- if not loop.last %}, {% endif %}
</li>
{%- endfor %}
</ul>
{{ content | safe }}
{%- if collections.posts %}
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
{%- set nextPost = collections.posts | getNextCollectionItem %}
{%- if nextPost or previousPost %}
<ul class="links-nextprev">
{%- if previousPost %}<li class="links-nextprev-prev">← Previous<br> <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}
{%- if nextPost %}<li class="links-nextprev-next">Next →<br><a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
</ul>
{%- endif %}
{%- endif %}
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
{%- set nextPost = collections.posts | getNextCollectionItem %}
{%- if nextPost or previousPost %}
<ul class="links-nextprev">
{%- if previousPost %}
<li class="links-nextprev-prev">← Previous<br>
<a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a>
</li>
{% endif %}
{%- if nextPost %}
<li class="links-nextprev-next">Next →<br>
<a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a>
</li>
{% endif %}
</ul>
{%- endif %}
{%- endif %}

View File

@@ -1,9 +1,14 @@
{%- css %}.postlist { counter-reset: start-from {{ (postslistCounter or postslist.length) + 1 }} }{% endcss %}
<ol reversed class="postlist">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("LLLL yyyy") }}</time>
</li>
{% endfor %}
</ol>
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url }}" class="postlist-link">
{% if post.data.title %}{{ post.data.title }}
{% else %}
<code>{{ post.url }}</code>
{% endif %}
</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("LLLL yyyy") }}</time>
</li>
{% endfor %}
</ol>