From b9a42b3a73afd180c4c4b2a003ff843daf382617 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 5 Mar 2026 15:42:00 +0100 Subject: [PATCH] feat: configurable post-graph section and dedicated /graph page - Add posting-activity.njk section template with configurable years/limit - Register posting-activity in homepage-section.njk dispatcher - Move hardcoded post-graph into Tier 2 block (homepage builder controls its own) - Add "View full history" link to /graph/ on both Tier 2 and section template - Create /graph/ page showing all years with no limit Confab-Link: http://localhost:8080/sessions/edb1b7b0-da66-4486-bd9c-d1cfa7553b88 --- _includes/components/homepage-section.njk | 2 ++ .../components/sections/posting-activity.njk | 24 +++++++++++++++++++ _includes/layouts/home.njk | 12 +++++++--- graph.njk | 18 ++++++++++++++ 4 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 _includes/components/sections/posting-activity.njk create mode 100644 graph.njk diff --git a/_includes/components/homepage-section.njk b/_includes/components/homepage-section.njk index e61e715..e7b8ee0 100644 --- a/_includes/components/homepage-section.njk +++ b/_includes/components/homepage-section.njk @@ -49,6 +49,8 @@ {% include "components/sections/funkwhale.njk" ignore missing %} {% elif section.type == "lastfm" %} {% include "components/sections/lastfm.njk" ignore missing %} +{% elif section.type == "posting-activity" %} + {% include "components/sections/posting-activity.njk" ignore missing %} {% else %} {% endif %} diff --git a/_includes/components/sections/posting-activity.njk b/_includes/components/sections/posting-activity.njk new file mode 100644 index 0000000..976dba5 --- /dev/null +++ b/_includes/components/sections/posting-activity.njk @@ -0,0 +1,24 @@ +{# Posting Activity Section — configurable post-graph contribution grid #} +{% set sectionConfig = section.config or {} %} +{% set graphTitle = sectionConfig.title or "Posting Activity" %} + +{% if collections.posts and collections.posts.length %} +
+

+ {{ graphTitle }} +

+ {% set graphOptions = {} %} + {% if sectionConfig.years and sectionConfig.years.length %} + {% set graphOptions = { only: sectionConfig.years } %} + {% elif sectionConfig.limit %} + {% set graphOptions = { limit: sectionConfig.limit } %} + {% endif %} + {% postGraph collections.posts, graphOptions %} + + View full history + + + + +
+{% endif %} diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk index 0aeb0c6..0f26556 100644 --- a/_includes/layouts/home.njk +++ b/_includes/layouts/home.njk @@ -140,12 +140,18 @@ withSidebar: true -{% endif %} {# end two-tier fallback #} - -{# Posting Activity — contribution graph (shown on all homepage variants) #} +{# Posting Activity — contribution graph (Tier 2 default only) #} {% if collections.posts and collections.posts.length %}

Posting Activity

{% postGraph collections.posts %} + + View full history + + + +
{% endif %} + +{% endif %} {# end two-tier fallback #} diff --git a/graph.njk b/graph.njk new file mode 100644 index 0000000..e6ef5e6 --- /dev/null +++ b/graph.njk @@ -0,0 +1,18 @@ +--- +layout: layouts/base.njk +title: Posting Activity +permalink: /graph/ +withSidebar: true +--- + +

Posting Activity

+ +

+ A contribution-style graph showing posting frequency across all years. +

+ +{% if collections.posts and collections.posts.length %} + {% postGraph collections.posts, { limit: 0 } %} +{% else %} +

No posts found.

+{% endif %}