Sort menu posts by publication date with YYYY-MM-DD shortened-title prefix

This commit is contained in:
trilium-share-gruvbox
2026-08-28 15:00:39 +02:00
parent a8d9c83ae7
commit 8c4ba5af94
4 changed files with 63 additions and 1 deletions
+5
View File
@@ -42,6 +42,11 @@ CSS file (Gruvbox, light + dark, theme toggle without reload).
between that section's pages (server-side `.blog-pagination`), not globally.
- **Article prev/next** (`scripts/prev_next.js`) is scoped to the article's category
(`blog_data.articles[].category`); falls back to the global list when uncategorized.
- **Menu sorting** (`scripts/menu_date_sort.js`, `shareHtmlLocation=body:end`): reads
`blog_data.articles[].date` (generator exposes the `date` label, fallback `dateCreated`,
`YYYY-MM-DD`), re-sorts each category's menu entries by date descending and prefixes the
label with `YYYY-MM-DD <shortened title>` (icons preserved). Non-article entries are left
in place.
- **Thumbnails** (`thumbSrc()`): prefer a child note of the article titled `*_thumb.*`
(e.g. `ngc281_thumb.jpg`) → `api/notes/<id>/download`; otherwise use the first `<img>`
from the note content. Layout: image left, summary right (`.blog-post-inner`),