diff --git a/src/_includes/macros/catalogue.njk b/src/_includes/macros/catalogue.njk index 7ba1bea..c7e405f 100644 --- a/src/_includes/macros/catalogue.njk +++ b/src/_includes/macros/catalogue.njk @@ -1,14 +1,37 @@ -{% macro list(posts) %} - +{% from "macros/utils.njk" import stars %} + +{% macro one(post, format) %} +
+ {{ post.data.title }} +

{{ post.date | formatDate("MM/DD") }}

+
+

{{ post.data.tags[1] }}

+ {% if post.data.rating %} + {{ stars(post.data.rating) }} + {% endif %} +
+
+{% endmacro %} + +{% macro list(posts) %} +
    + {% for post in posts %} +
  1. + {{ one(post, format) }} +
  2. + {% endfor %} +
+{% endmacro %} + +{% macro yearList(posts, year, format = "MM/DD") %} +
+
+

{{ year }}

+

+ {{ posts | length }} +

+
+ {{ list(posts, format) }} +
{% endmacro %} diff --git a/src/_includes/macros/posts.njk b/src/_includes/macros/posts.njk index b9b15f5..6e411e4 100644 --- a/src/_includes/macros/posts.njk +++ b/src/_includes/macros/posts.njk @@ -1,13 +1,29 @@ +{% macro one(post, format = "MM/DD") %} +
+ {{ post.data.title }} +

{{ post.date | formatDate(format) }}

+

{{ post.data.excerpt }}

+
+{% endmacro %} + {% macro list(posts, format = "MM/DD") %} - + +{% endmacro %} + +{% macro yearList(posts, year, format = "MM/DD") %} +
+
+

{{ year }}

+

+ {{ posts | length }} +

+
+ {{ list(posts, format) }} +
{% endmacro %} diff --git a/src/catalogue-type.html b/src/catalogue-type.html index 6b0e320..c6d600c 100644 --- a/src/catalogue-type.html +++ b/src/catalogue-type.html @@ -12,7 +12,7 @@ eleventyComputed: title: Catalogue - {{ type | pluralize | capitalize }} --- -{% from "macros/catalogue.njk" import list %} +{% from "macros/catalogue.njk" import yearList %}

{{ type | pluralize | capitalize }}

{% set catalogueTypes = collections.catalogueByType | keys %}