mirror of
https://github.com/helenclx/leilukin-site.git
synced 2025-04-02 21:10:52 +00:00
Use Nunjucks macro for article lists
This commit is contained in:
parent
227f11eb5b
commit
4cec339f0d
@ -1,3 +1,16 @@
|
|||||||
|
{%- macro articleList(tag) -%}
|
||||||
|
<ul>
|
||||||
|
{%- for article in collections[tag] -%}
|
||||||
|
<li>
|
||||||
|
<p class="item-list__title">
|
||||||
|
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
||||||
|
</p>
|
||||||
|
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
||||||
|
</li>
|
||||||
|
{%- endfor -%}
|
||||||
|
</ul>
|
||||||
|
{%- endmacro -%}
|
||||||
|
|
||||||
{%- macro modEntry(params) -%}
|
{%- macro modEntry(params) -%}
|
||||||
{% headingAnchor 3 %}{{ params.title }}{% endheadingAnchor %}
|
{% headingAnchor 3 %}{{ params.title }}{% endheadingAnchor %}
|
||||||
<div class="mod-entry">
|
<div class="mod-entry">
|
||||||
|
@ -12,17 +12,10 @@ eleventyNavigation:
|
|||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% from "global/macros.njk" import articleList with context %}
|
||||||
|
|
||||||
## My {% cite "Cassette Beasts" %} Articles
|
## My {% cite "Cassette Beasts" %} Articles
|
||||||
<ul>
|
{{ articleList("cassette beasts articles") }}
|
||||||
{%- for article in collections["cassette beasts articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## {% cite "Cassette Beasts" %} Articles I Recommend
|
## {% cite "Cassette Beasts" %} Articles I Recommend
|
||||||
|
|
||||||
|
@ -12,41 +12,16 @@ eleventyNavigation:
|
|||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% from "global/macros.njk" import articleList with context %}
|
||||||
|
|
||||||
## My Articles for Both Games
|
## My Articles for Both Games
|
||||||
<ul>
|
{{ articleList("kotor both articles") }}
|
||||||
{%- for article in collections["kotor both articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## My KotOR 1 Articles
|
## My KotOR 1 Articles
|
||||||
<ul>
|
{{ articleList("kotor 1 articles") }}
|
||||||
{%- for article in collections["kotor 1 articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## My KotOR 2 Articles
|
## My KotOR 2 Articles
|
||||||
<ul>
|
{{ articleList("kotor 2 articles") }}
|
||||||
{%- for article in collections["kotor 2 articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## KotOR Articles I Recommend
|
## KotOR Articles I Recommend
|
||||||
|
|
||||||
|
@ -12,17 +12,10 @@ eleventyNavigation:
|
|||||||
order: 2
|
order: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% from "global/macros.njk" import articleList with context %}
|
||||||
|
|
||||||
## My KotOR Guides
|
## My KotOR Guides
|
||||||
<ul>
|
{{ articleList("kotor guides") }}
|
||||||
{%- for article in collections["kotor guides"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## KotOR 1 Guides by Others
|
## KotOR 1 Guides by Others
|
||||||
* [{% cite "Star Wars: Knights of the Old Republic" %} section](https://strategywiki.org/wiki/Star_Wars:_Knights_of_the_Old_Republic) on StrategyWiki
|
* [{% cite "Star Wars: Knights of the Old Republic" %} section](https://strategywiki.org/wiki/Star_Wars:_Knights_of_the_Old_Republic) on StrategyWiki
|
||||||
|
@ -6,18 +6,11 @@ eleventyNavigation:
|
|||||||
order: 5
|
order: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
|
{% from "global/macros.njk" import articleList with context %}
|
||||||
|
|
||||||
## My Articles
|
## My Articles
|
||||||
Articles I have written.
|
Articles I have written.
|
||||||
<ul>
|
{{ articleList("my articles") }}
|
||||||
{%- for article in collections["my articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
## My Articles for Video Games with Their Own Pages
|
## My Articles for Video Games with Their Own Pages
|
||||||
* My {% cite "Cassette Beasts" %} shrine [Articles](/shrines/cassettebeasts/articles/) page
|
* My {% cite "Cassette Beasts" %} shrine [Articles](/shrines/cassettebeasts/articles/) page
|
||||||
@ -25,13 +18,4 @@ Articles I have written.
|
|||||||
|
|
||||||
## Featured Articles
|
## Featured Articles
|
||||||
Articles featuring other people's interview with me.
|
Articles featuring other people's interview with me.
|
||||||
<ul>
|
{{ articleList("featured articles") }}
|
||||||
{%- for article in collections["featured articles"] -%}
|
|
||||||
<li>
|
|
||||||
<p class="item-list__title">
|
|
||||||
<a href="{{ article.url }}">{{ article.data.articleTitle }}</a>
|
|
||||||
</p>
|
|
||||||
<time datetime="{{ article.date }}">{{ article.date | formatDate }}</time>
|
|
||||||
</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
Loading…
x
Reference in New Issue
Block a user