feat: add trip/trips/stories templates, update nav and map/stats to use trip-relative paths
- Rename tracker.html.twig to dailies.html.twig; update dailies.md template key - Fix map.html.twig and stats.html.twig: find dailies via page.parent().route - Update base.html.twig nav to use config.site.active_trip for all hrefs - Fix dailies.html.twig mini-map link to use page.parent().url/map - Create trip.html.twig, trips.html.twig, stories.html.twig Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% block content %}
|
||||
{% set tracker_page = grav.pages.find(page.route ~ '/dailies') %}
|
||||
{% set entries = tracker_page ? tracker_page.children.published() : [] %}
|
||||
|
||||
<div class="trip-hero">
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% if page.header.date_start %}
|
||||
<p class="trip-dates">
|
||||
{{ page.header.date_start|date('d M Y') }}
|
||||
{% if page.header.date_end %} — {{ page.header.date_end|date('d M Y') }}{% endif %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<nav class="trip-nav">
|
||||
<a href="{{ page.route }}/dailies">Journal</a>
|
||||
<a href="{{ page.route }}/map">Map</a>
|
||||
<a href="{{ page.route }}/stats">Stats</a>
|
||||
<a href="{{ page.route }}/stories">Stories</a>
|
||||
</nav>
|
||||
|
||||
{% if entries|length > 0 %}
|
||||
<section class="trip-recent">
|
||||
<h2>Recent entries</h2>
|
||||
{% for entry in entries|slice(0, 3) %}
|
||||
<a href="{{ entry.url }}">
|
||||
<span>{{ entry.date|date('d M Y') }}</span>
|
||||
{{ entry.title }}
|
||||
{% if entry.header.location_city %} · {{ entry.header.location_city }}{% endif %}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user