Convert blog navigation template to Vento

This commit is contained in:
2025-05-03 12:28:43 +08:00
parent 08f3d7f38a
commit 7e5a0e5201
3 changed files with 18 additions and 18 deletions
-17
View File
@@ -1,17 +0,0 @@
{% set currentUrl %}{{ page.url }}{% endset %}
<aside class="right-sidebar">
<nav class="blog__nav sidebar--sticky" aria-labelledby="blog-nav-title">
<h2 class="blog__nav--title" id="blog-nav-title">Blog Navigation</h2>
<ul class="blog__nav--links">
<li><a {% if page.url == "/blog/" %}aria-current="page"{% endif %} href="/blog/">Index</a></li>
{% set navPages = collections.all | eleventyNavigation("Blog") %}
{%- for entry in navPages %}
<li><a
{% if entry.url == page.url %}aria-current="page"{% endif %}
href="{{ entry.url }}">
{{ entry.title }}
</a></li>
{%- endfor %}
</ul>
</nav>
</aside>
+17
View File
@@ -0,0 +1,17 @@
{{ set currentUrl }}{{ page.url }}{{ /set }}
<aside class="right-sidebar">
<nav class="blog__nav sidebar--sticky" aria-labelledby="blog-nav-title">
<h2 class="blog__nav--title" id="blog-nav-title">Blog Navigation</h2>
<ul class="blog__nav--links">
<li><a {{ if page.url == "/blog/" }}aria-current="page"{{ /if }} href="/blog/">Index</a></li>
{{ set navPages = collections.all |> eleventyNavigation("Blog") }}
{{ for entry of navPages }}
<li><a
{{ if entry.url == page.url }}aria-current="page"{{ /if }}
href="{{ entry.url }}">
{{ entry.title }}
</a></li>
{{ /for }}
</ul>
</nav>
</aside>
+1 -1
View File
@@ -62,6 +62,6 @@ layout: global/base
</{{contentEl}}>
{% if tags and tags.includes("blog pages") %}
{% include "blog/blognav.njk" %}
{% include "blog/blognav.vto" %}
{% endif %}
</content-wrapper>