From 85082510dd3477dd994954988ba27e8f00e87945 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 8 Mar 2026 15:33:30 +0100 Subject: [PATCH] fix(where): resolve duplicate permalink output --- _includes/layouts/where.njk | 134 ++++++++++++++++++ content/pages/where.md | 1 + .../_includes/layouts/where.njk | 9 +- 3 files changed, 141 insertions(+), 3 deletions(-) create mode 100644 _includes/layouts/where.njk rename where.njk => theme/_includes/layouts/where.njk (97%) diff --git a/_includes/layouts/where.njk b/_includes/layouts/where.njk new file mode 100644 index 0000000..bb67132 --- /dev/null +++ b/_includes/layouts/where.njk @@ -0,0 +1,134 @@ +--- +layout: layouts/base.njk +withSidebar: true +--- +{% set checkins = whereCheckins.checkins or [] %} + +
+
+

{{ title or "Where" }}

+

+ Recent check-ins from Swarm via OwnYourSwarm, rendered from check-in metadata. +

+ {% if content %} +
+ {{ content | safe }} +
+ {% endif %} + {% if whereCheckins.available %} +

+ Loaded {{ whereCheckins.stats.total }} check-ins{% if whereCheckins.stats.withCoordinates %} ({{ whereCheckins.stats.withCoordinates }} with coordinates){% endif %}. +

+ {% endif %} +
+ + {% if checkins.length %} +
+ {% for checkin in checkins %} +
+
+
+ +
+ +
+

+ {% if checkin.venueUrl %} + {{ checkin.name }} + {% else %} + {{ checkin.name }} + {% endif %} +

+ + {% if checkin.locationText or checkin.postalCode %} +

+ {{ checkin.locationText }}{% if checkin.locationText and checkin.postalCode %}, {% endif %}{{ checkin.postalCode }} +

+ {% endif %} + +
+ {% if checkin.published %} + + {% endif %} + {% if checkin.coordinatesText %} + {{ checkin.coordinatesText }} + {% endif %} + {% if checkin.isPrivate %} + Private + {% endif %} + {% if checkin.checkedInBy and (checkin.checkedInBy.name or checkin.checkedInBy.url) %} + + Checked in by {% if checkin.checkedInBy.url %}{{ checkin.checkedInBy.name or checkin.checkedInBy.url }}{% else %}{{ checkin.checkedInBy.name }}{% endif %} + + {% endif %} +
+ + {% if checkin.tags and checkin.tags.length %} +
+ {% for tag in checkin.tags | head(8) %} + #{{ tag }} + {% endfor %} +
+ {% endif %} + + {% if checkin.taggedPeople and checkin.taggedPeople.length %} +
+ {% for person in checkin.taggedPeople | head(6) %} + {% if person.url %} + {{ person.name or person.url }} + {% else %} + {{ person.name }} + {% endif %} + {% endfor %} +
+ {% endif %} + +
+ {% if checkin.syndication %} + Swarm + {% endif %} + {% if checkin.mapUrl %} + Map + {% endif %} + {% if checkin.venueWebsiteUrl %} + Website + {% endif %} + {% if checkin.venueSocialUrl %} + Social + {% endif %} +
+ + {% if checkin.photos and checkin.photos.length %} +
+ {% for photo in checkin.photos | head(3) %} + + Check-in photo + + {% endfor %} +
+ {% endif %} +
+
+
+ {% endfor %} +
+ {% else %} +
+

No check-ins available yet

+

+ This page expects an endpoint that returns MF2 JSON h-entry checkins with properties like published, checkin, location, category, and checked-in-by. +

+ {% if whereCheckins.feedUrl %} +

+ Current feed URL: {{ whereCheckins.feedUrl }} +

+ {% endif %} +

+ Configure OWNYOURSWARM_FEED_URL (and optionally OWNYOURSWARM_FEED_TOKEN) in your environment or deploy secrets. +

+
+ {% endif %} +
\ No newline at end of file diff --git a/content/pages/where.md b/content/pages/where.md index 4f68117..5218a0f 100644 --- a/content/pages/where.md +++ b/content/pages/where.md @@ -1,4 +1,5 @@ --- +layout: layouts/where.njk date: 2026-03-08T13:55:46.901Z title: where category: diff --git a/where.njk b/theme/_includes/layouts/where.njk similarity index 97% rename from where.njk rename to theme/_includes/layouts/where.njk index 1bf9c6d..4a49680 100644 --- a/where.njk +++ b/theme/_includes/layouts/where.njk @@ -1,17 +1,20 @@ --- layout: layouts/base.njk -title: Where -permalink: /where/ withSidebar: true --- {% set checkins = whereCheckins.checkins or [] %}
-

Where

+

{{ title or "Where" }}

Recent check-ins from Swarm via OwnYourSwarm, rendered from check-in metadata.

+ {% if content %} +
+ {{ content | safe }} +
+ {% endif %} {% if whereCheckins.available %}

Loaded {{ whereCheckins.stats.total }} check-ins{% if whereCheckins.stats.withCoordinates %} ({{ whereCheckins.stats.withCoordinates }} with coordinates){% endif %}.