auto-colored tags for posts
This commit is contained in:
parent
4cd8d22238
commit
04e4b0e51e
17 changed files with 152 additions and 64 deletions
|
@ -1,29 +1,13 @@
|
|||
---
|
||||
layout: "base.njk"
|
||||
---
|
||||
{%- from "components/collectionList.njk" import collectionList with context -%}
|
||||
<main data-pagefind-body>
|
||||
{{ content | safe }}
|
||||
{%- for name, collection in collections -%}
|
||||
{%- if name in ["posts"] -%}
|
||||
<h2>{{name | capitalize }}</h2>
|
||||
<ul class="collection">
|
||||
{%- for item in collection | reverse -%}
|
||||
{%- if (loop.index <= 5) -%}
|
||||
<li>
|
||||
<a href="{{item.url}}">{{item.data.title}}</a>
|
||||
{%- if item.data.date -%}
|
||||
<aside>{{item.data.date | formatDate("MMMM DD, YYYY") }}</aside>
|
||||
{%- endif -%}
|
||||
<p>{{item.data.description | safe}}</p>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- if (loop.index == 6) -%}
|
||||
<li>
|
||||
<a href="/{{name}}/">More {{name}}…</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{{ collectionList(collection, limit=5) }}
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</main>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue