From f2865234558a77c022966d9a7666d793c71b4ea2 Mon Sep 17 00:00:00 2001 From: Devin Haska Date: Tue, 27 Feb 2024 22:26:49 -0800 Subject: [PATCH] feat: various markup improvements for semantic --- src/_includes/macros/catalogue.njk | 47 ++++++++++++++++++++++-------- src/_includes/macros/posts.njk | 32 +++++++++++++++----- src/catalogue-type.html | 7 ++--- src/catalogue.html | 7 ++--- src/css/blocks/posts.css | 2 +- src/css/utilities/fonts.css | 4 +++ src/index.html | 14 +++++---- src/posts.html | 7 ++--- src/tag.html | 7 ++--- 9 files changed, 81 insertions(+), 46 deletions(-) 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 %}