Files
indiekit-blog/_includes/components/sections/posting-activity.njk
Ricardo b9a42b3a73 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
2026-03-05 15:42:00 +01:00

25 lines
1.1 KiB
Plaintext

{# 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 %}
<section class="mb-8 sm:mb-12">
<h2 class="text-xl sm:text-2xl font-bold text-surface-900 dark:text-surface-100 mb-4 sm:mb-6">
{{ graphTitle }}
</h2>
{% 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 %}
<a href="/graph/" class="text-sm text-accent-600 dark:text-accent-400 hover:underline mt-4 inline-flex items-center gap-1">
View full history
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</a>
</section>
{% endif %}