Rework diary to focus on yearly pages

This commit is contained in:
2026-05-28 13:54:44 +02:00
parent 20a6bac3d6
commit 61e50c033f
14 changed files with 641 additions and 402 deletions
+1 -1
View File
@@ -28,7 +28,7 @@
{{if or .Content .SpecialContent}}
<script src="/_/page/content.js"></script>
<script src="/_/page/anchors.js"></script>
<script src="/_/page/toc.js"></script>
{{if not .SuppressTOC}}<script src="/_/page/toc.js"></script>{{end}}
<script src="/_/page/tasks.js"></script>
{{end}}
{{if .Content}}
+5 -1
View File
@@ -6,12 +6,16 @@
// Section 0 is pre-heading content, editable via full-page edit.
// Sections 1..N each start at a heading; that is the index sent to the server.
// Skip headings that already carry a server-rendered edit link (the diary
// slice templates bake their own edit URLs pointing at the year file).
headings.forEach(function (h, i) {
if (h.querySelector('a.btn')) return;
var a = document.createElement('a');
a.href = '?edit&section=' + (i + 1);
a.className = 'btn btn-small';
a.textContent = 'edit';
a.textContent = 'edit';
h.appendChild(document.createTextNode(' '))
h.appendChild(a);
});
}());
``