auto-colored tags for posts
This commit is contained in:
parent
4cd8d22238
commit
04e4b0e51e
17 changed files with 152 additions and 64 deletions
23
site/_includes/components/collectionList.njk
Normal file
23
site/_includes/components/collectionList.njk
Normal file
|
@ -0,0 +1,23 @@
|
|||
{%- from "components/tagList.njk" import tagList with context -%}
|
||||
|
||||
{% macro collectionList(collection, limit=0) %}
|
||||
<ul class="collection">
|
||||
{%- for item in collection | reverse -%}
|
||||
{%- if (limit === 0 or loop.index <= limit) -%}
|
||||
<li>
|
||||
<a href="{{item.url}}">{{item.data.title}}</a>
|
||||
{%- if item.data.date -%}
|
||||
<aside>{{item.data.date | formatDate("MMMM DD, YYYY") }}</aside>
|
||||
{%- endif -%}
|
||||
<aside>{{ tagList(item.data.tags.slice(1)) }}</aside>
|
||||
<p>{{item.data.description | safe}}</p>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- if (limit !== 0 and loop.index == limit + 1) -%}
|
||||
<li>
|
||||
<a href="/{{name}}/">More {{name}}…</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{% endmacro %}
|
Loading…
Add table
Add a link
Reference in a new issue