feat: update catalogue list

This commit is contained in:
Devin Haska 2024-03-01 15:48:42 -08:00
parent e2d26a8b9a
commit b5fd748a55
5 changed files with 13 additions and 10 deletions

View file

@ -1,11 +1,10 @@
{% from "macros/utils.njk" import stars %}
{% macro one(post, format) %}
{% macro one(post, format, showType = true) %}
<article class="[ posts-list-item column-gap-0.5 justify-between line-height-m ]">
<a href="{{ post.url }}">{{ post.data.title }}</a>
<time datetime="{{ post.date }}" class="[ text-fadeText ]">{{ post.date | formatDate("MM/DD") }}</time>
<div class="[ cluster mt-0.5 ]">
<div class="[ font-size-s ]"><p class="[ pill ]" data-state="small">{{ post.data.tags[1] }}</p></div>
<div class="[ cluster gap-0.5 ]"><a href="{{ post.url }}" class="[ line-height-m ]">{{ post.data.title }}</a>
{% if showType %}<p class="[ font-size-s text-fadeText ]">{{ post.data.tags[1] }}</p>{% endif %}</div>
<div class="[ cluster ]">
{% if post.data.rating %}
{{ stars(post.data.rating) }}
{% endif %}
@ -13,17 +12,17 @@
</article>
{% endmacro %}
{% macro list(posts) %}
{% macro list(posts, showType = true) %}
<ol class="[ flow p-0 ]" role="list">
{% for post in posts %}
<li>
{{ one(post, format) }}
{{ one(post, format, showType) }}
</li>
{% endfor %}
</ol>
{% endmacro %}
{% macro yearList(posts, year, format = "MM/DD") %}
{% macro yearList(posts, year, format = "MM/DD", showType = true) %}
<section class="[ flow ]">
<header class="[ cluster gap-0.5 ]">
<h2>{{ year }}</h2>

View file

@ -1,5 +1,8 @@
{% set catalogueTypes = collections.catalogueByType | keys %}
<ul class="[ cluster p-0 gap-0.5 ]" role="list">
<li>
<a class="[ pill ]" href="/catalogue">all<span class="[ pill-count ]">{{ collections.catalogue | length }}</span></a>
</li>
{% for type in catalogueTypes %}
<li>
<a class="[ pill ]" href="/catalogue/{{ type | pluralize }}">{{ type | pluralize }}<span class="[ pill-count ]">{{ collections.catalogueByType[ type ] | length }}</span></a>

View file

@ -1,7 +1,7 @@
<ul class="[ list-none cluster p-0 m-0 ]">
{% for item in navigation.top %}
<li>
<a href="{{ item.url }}" {{ helpers.getLinkActiveState(item.url, page.url) | safe }}>{{ item.text }}</a>
<a href="{{ item.url }}">{{ item.text }}</a>
</li>
{% endfor %}
</ul>

View file

@ -20,6 +20,6 @@ eleventyComputed:
<section class="[ flow ]">
{% for year in years %}
{% set itemsInYear = itemsByYear[year] %}
{{ yearList(itemsInYear, year) }}
{{ yearList(itemsInYear, year, false) }}
{% endfor %}
</section>

View file

@ -15,6 +15,7 @@
font-size: 0.8rem;
line-height: 0.8rem;
padding-inline: var(--spacing-0\.5);
padding-block: var(--spacing-0\.25);
border-radius: var(--spacing-0\.25);
}