tidy up notes index page

This commit is contained in:
2025-05-24 22:37:41 +01:00
parent a8b6d8674b
commit ab30cc0e38
5 changed files with 73 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
<nav>
<nav class="navbar">
<ul>
<li>
<a href="/">Home</a>

View File

@@ -1,41 +1,60 @@
{% extends 'base.html.twig' %}
{% block content %}
<section>
<h1>Notes</h1>
<p>
<section class="h-feed">
<h1 class="p-name">Joe Carstairs' notes</h1>
<p hidden>
These links are collected by
<a class="p-author h-card" href="{{ path('index') }}">
Joe Carstairs
</a>.
</p>
<p hidden>
<a class="u-url" href="{{ path('notes') }}">Permalink</a>
</p>
<nav class="skip-to">
Skip to:
<ul>
{% for year in years %}
<li><a href="#{{ year }}">{{ year }}</a></li>
{% endfor %}
</ul>
</p>
</nav>
{% for year in years %}
<h2 id="{{ year }}">{{ year }}</h2>
<p>
<nav class="skip-to">
Skip to:
<ul>
{% for month in months[year] %}
<li><a href="#{{ year }}-{{ month }}">{{ monthNames[month] }} {{ year }}</a></li>
<li><a href="#{{ year }}-{{ month }}">
{{ monthNames[month] }} <span class="visually-hidden">{{ year }}</span>
</a></li>
{% endfor %}
</ul>
</p>
</nav>
{% for month in months[year] %}
<h3 id="{{ year }}-{{ month }}">{{ monthNames[month] }}</h3>
{% for note in notes[year][month] %}
<h4><a href="/notes/{{ note.slug }}">Note {{ note.slug }}</a></h4>
<time datetime="{{ note.publishedDate.format('c') }}">
{{ note.publishedDate.format('j F Y') }}
</time>
{% apply markdown_to_html %}
{{ note.content }}
{% endapply %}
<section class="h-entry">
<h4><a class="p-name u-url" href="/notes/{{ note.slug }}">
Note {{ note.slug }}
</a></h4>
<time class="dt-published" datetime="{{ note.publishedDate.format('c') }}">
{{ note.publishedDate.format('j F Y') }}
</time>
<section class="e-content">
{% apply markdown_to_html %}
{{ note.content }}
{% endapply %}
</section>
</section>
{% endfor %}
{% endfor %}
{% else %}