feat: move /where override to base, add /been for past check-ins, remove upstream theme/where.njk

This commit is contained in:
svemagie
2026-03-11 07:42:19 +01:00
parent 3786e745b6
commit a7a1911ef6
3 changed files with 63 additions and 33 deletions
+25 -21
View File
@@ -10,6 +10,9 @@ withSidebar: true
<p class="text-surface-600 dark:text-surface-400"> <p class="text-surface-600 dark:text-surface-400">
Recent check-ins captured by this site via Micropub. Recent check-ins captured by this site via Micropub.
</p> </p>
<p class="mt-2 text-sm">
<a href="/been/" class="text-accent-600 hover:underline">See all past check-ins →</a>
</p>
{% if content %} {% if content %}
<div class="prose prose-surface dark:prose-invert max-w-none mt-3"> <div class="prose prose-surface dark:prose-invert max-w-none mt-3">
{{ content | safe }} {{ content | safe }}
@@ -48,29 +51,30 @@ withSidebar: true
<span class="px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700">{{ checkin.coordinatesText }}</span> <span class="px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700">{{ checkin.coordinatesText }}</span>
{% endif %} {% endif %}
{% if checkin.isPrivate %} {% if checkin.isPrivate %}
<span class="px-2 py-0.5 rounded-full bg-amber-100 dark:bg-amber-900/40 text-amber-800 dark:text-amber-300">Private</span> <section class="space-y-4" aria-label="Recent check-ins">
{% endif %} {% if checkins.length %}
{% if checkin.checkedInBy and (checkin.checkedInBy.name or checkin.checkedInBy.url) %} {% set checkin = checkins[0] %}
<span class="px-2 py-0.5 rounded-full bg-surface-100 dark:bg-surface-700"> <article class="p-4 sm:p-5 bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm">
Checked in by {% if checkin.checkedInBy.url %}<a href="{{ checkin.checkedInBy.url }}" class="hover:text-emerald-600 dark:hover:text-emerald-400" target="_blank" rel="noopener">{{ checkin.checkedInBy.name or checkin.checkedInBy.url }}</a>{% else %}{{ checkin.checkedInBy.name }}{% endif %} <div class="flex items-start gap-3 sm:gap-4">
</span> <div class="w-10 h-10 rounded-full bg-emerald-100 dark:bg-emerald-900/40 flex items-center justify-center flex-shrink-0 mt-0.5">
{% endif %} <svg class="w-5 h-5 text-emerald-700 dark:text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
</div> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17.657 16.657L13.414 20.9a2 2 0 01-2.828 0l-4.243-4.243a8 8 0 1111.314 0z"/>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"/>
</svg>
</div>
{% if checkin.tags and checkin.tags.length %} <div class="flex-1 min-w-0">
<div class="mt-3 flex flex-wrap gap-2 text-xs"> <h2 class="text-base sm:text-lg font-semibold text-surface-900 dark:text-surface-100">
{% for tag in checkin.tags | head(8) %} {{ checkin.name }}
<span class="inline-flex items-center px-2.5 py-1 rounded-full bg-indigo-100 dark:bg-indigo-900/30 text-indigo-800 dark:text-indigo-300">#{{ tag }}</span> </h2>
{% endfor %}
</div>
{% endif %}
{% if checkin.taggedPeople and checkin.taggedPeople.length %} {% if checkin.locationText or checkin.postalCode %}
<div class="mt-2 flex flex-wrap gap-2 text-xs"> <p class="text-sm text-surface-600 dark:text-surface-400 mt-1">
{% for person in checkin.taggedPeople | head(6) %} {{ checkin.locationText }}{% if checkin.locationText and checkin.postalCode %}, {% endif %}{{ checkin.postalCode }}
{% if person.url %} </p>
<a href="{{ person.url }}" class="inline-flex items-center px-2.5 py-1 rounded-full bg-surface-100 dark:bg-surface-700 text-surface-700 dark:text-surface-300 hover:bg-surface-200 dark:hover:bg-surface-600" target="_blank" rel="noopener">{{ person.name or person.url }}</a> {% endif %}
{% else %}
<div class="text-xs text-surface-600 dark:text-surface-400 mt-2 flex flex-wrap items-center gap-2">
<span class="inline-flex items-center px-2.5 py-1 rounded-full bg-surface-100 dark:bg-surface-700 text-surface-700 dark:text-surface-300">{{ person.name }}</span> <span class="inline-flex items-center px-2.5 py-1 rounded-full bg-surface-100 dark:bg-surface-700 text-surface-700 dark:text-surface-300">{{ person.name }}</span>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
+32
View File
@@ -0,0 +1,32 @@
---
layout: layouts/been.njk
title: Been
permalink: /been/
withSidebar: true
---
{% set checkins = whereCheckins.checkins or [] %}
<div class="been-page">
<header class="mb-6 sm:mb-8">
<h1 class="text-2xl sm:text-3xl md:text-4xl font-bold text-surface-900 dark:text-surface-100 mb-2">Been</h1>
<p class="text-surface-600 dark:text-surface-400">
All past check-ins captured by this site via Micropub.
</p>
</header>
{% if checkins.length > 1 %}
<section class="space-y-4" aria-label="Past check-ins">
{% for checkin in checkins | slice(1) %}
<article class="p-4 sm:p-5 bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm">
{# ...existing checkin rendering code from where.njk... #}
</article>
{% endfor %}
</section>
{% else %}
<p class="text-surface-600 dark:text-surface-400">No past check-ins found.</p>
{% endif %}
<p class="mt-2 text-sm">
<a href="/where/" class="text-accent-600 hover:underline">Back to newest check-in →</a>
</p>
</div>
+6 -12
View File
@@ -12,11 +12,14 @@ withSidebar: true
<p class="text-surface-600 dark:text-surface-400"> <p class="text-surface-600 dark:text-surface-400">
Recent check-ins captured by this site via Micropub. Recent check-ins captured by this site via Micropub.
</p> </p>
<p class="mt-2 text-sm">
<a href="/been/" class="text-accent-600 hover:underline">See all past check-ins →</a>
</p>
</header> </header>
{% if checkins.length %} {% if checkins.length %}
<section class="space-y-4" aria-label="Recent check-ins"> <section class="space-y-4" aria-label="Recent check-ins">
{% for checkin in checkins %} {% set checkin = checkins[0] %}
<article class="p-4 sm:p-5 bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm"> <article class="p-4 sm:p-5 bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm">
<div class="flex items-start gap-3 sm:gap-4"> <div class="flex items-start gap-3 sm:gap-4">
<div class="w-10 h-10 rounded-full bg-emerald-100 dark:bg-emerald-900/40 flex items-center justify-center flex-shrink-0 mt-0.5"> <div class="w-10 h-10 rounded-full bg-emerald-100 dark:bg-emerald-900/40 flex items-center justify-center flex-shrink-0 mt-0.5">
@@ -90,7 +93,7 @@ withSidebar: true
<div class="mt-3 flex flex-wrap gap-2"> <div class="mt-3 flex flex-wrap gap-2">
{% for photo in checkin.photos | head(3) %} {% for photo in checkin.photos | head(3) %}
<a href="{{ photo }}" target="_blank" rel="noopener" class="block"> <a href="{{ photo }}" target="_blank" rel="noopener" class="block">
<img src="{{ photo }}" alt="Check-in photo" class="w-16 h-16 sm:w-20 sm:h-20 rounded-lg object-cover border border-surface-200 dark:border-surface-700" loading="lazy" eleventy:ignore> <img src="{{ photo }}" alt="Check-in photo" class="w-24 h-24 object-cover rounded-lg border border-surface-200 dark:border-surface-700" loading="lazy" />
</a> </a>
{% endfor %} {% endfor %}
</div> </div>
@@ -98,17 +101,8 @@ withSidebar: true
</div> </div>
</div> </div>
</article> </article>
{% endfor %}
</section> </section>
{% else %} {% else %}
<section class="p-4 sm:p-5 bg-surface-50 dark:bg-surface-800 rounded-lg border border-surface-200 dark:border-surface-700 shadow-sm" aria-live="polite"> <p class="text-surface-600 dark:text-surface-400">No check-ins found.</p>
<h2 class="text-lg font-semibold text-surface-900 dark:text-surface-100 mb-2">No check-ins available yet</h2>
<p class="text-sm text-surface-600 dark:text-surface-400 mb-2">
This page reads local content created by your Micropub endpoint. Check-ins appear here when posts include fields like <code>checkin</code>, <code>location</code>, or coordinates.
</p>
<p class="text-sm text-surface-600 dark:text-surface-400 mb-2">
Scanned <code>{{ whereCheckins.scannedFiles or 0 }}</code> content files{% if whereCheckins.errors and whereCheckins.errors.length %} with {{ whereCheckins.errors.length }} parse warning(s){% endif %}.
</p>
</section>
{% endif %} {% endif %}
</div> </div>