fix More link
This commit is contained in:
parent
a9ab7eb6ce
commit
fed5c2a424
4 changed files with 6 additions and 8 deletions
|
@ -10,6 +10,6 @@ eleventyComputed:
|
|||
</section>
|
||||
{% set tag = page.fileSlug %}
|
||||
{% if collections[tag] %}
|
||||
{{ collectionList(collections[tag]) }}
|
||||
{{ collectionList(tag) }}
|
||||
{% endif %}
|
||||
</main>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{%- from "components/tagList.njk" import tagList with context -%}
|
||||
|
||||
{% macro collectionList(collection, limit=0) %}
|
||||
{% macro collectionList(tagName, limit=0) %}
|
||||
<ul class="collection">
|
||||
{%- for item in collection | reverse -%}
|
||||
{%- for item in collections[tagName] | reverse -%}
|
||||
{%- if (limit === 0 or loop.index <= limit) -%}
|
||||
<li>
|
||||
<a href="{{item.url}}">{{item.data.title}}</a>
|
||||
|
@ -15,7 +15,7 @@
|
|||
{%- endif -%}
|
||||
{%- if (limit !== 0 and loop.index == limit + 1) -%}
|
||||
<li>
|
||||
<a href="/{{name}}/">More {{name}}…</a>
|
||||
<a href="/{{tagName}}/">More {{tagName}}…</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
|
|
|
@ -7,7 +7,7 @@ layout: "base.njk"
|
|||
{%- for name, collection in collections -%}
|
||||
{%- if name in ["posts"] -%}
|
||||
<h2>{{name | capitalize }}</h2>
|
||||
{{ collectionList(collection, limit=5) }}
|
||||
{{ collectionList(name, limit=5) }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</main>
|
||||
|
|
|
@ -18,7 +18,5 @@ useTitle: true
|
|||
<section data-pagefind-body>
|
||||
{{ content | safe }}
|
||||
</section>
|
||||
{% if collections[tag] %}
|
||||
{{ collectionList(collections[tag]) }}
|
||||
{% endif %}
|
||||
{{ collectionList(tag) }}
|
||||
</main>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue