diff --git a/AGENTS.md b/AGENTS.md index 6ffe30d..d8b2cdc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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 ` (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//download`; otherwise use the first `` from the note content. Layout: image left, summary right (`.blog-post-inner`), diff --git a/README.md b/README.md index ba17150..4c8e296 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ no external dependencies (except `highlight.js`, vendored in `lib/`). - Gruvbox light/dark theme for the share, with a theme toggle in the header. - Blog index, category pages, sub-categories, tags and tag overview. +- **Menu sorting**: articles in the left menu are sorted by publication date (newest first) + and labelled `YYYY-MM-DD ` automatically. - **Article thumbnails**: each post card shows the first image of the article on the left (bounded by the teaser height), summary on the right, lazy-loaded. If an article has a child note named `*_thumb.*` (e.g. `ngc281_thumb.jpg`), that image is used instead – ideal for diff --git a/blog_generator.js b/blog_generator.js index 4b29c66..933f982 100644 --- a/blog_generator.js +++ b/blog_generator.js @@ -387,7 +387,8 @@ function run() { url: SHARE_BASE + "/" + encodeURIComponent(a.getLabelValue("shareAlias") || a.noteId), summary: a.getLabelValue("summary") || "", tags: tagList(a), - category: a.getLabelValue("category") || "" + category: a.getLabelValue("category") || "", + date: (a.getLabelValue("date") || a.dateCreated).slice(0, 10) })); const html = ``; if (dataNote.getContent() !== html) { diff --git a/scripts/menu_date_sort.js b/scripts/menu_date_sort.js new file mode 100644 index 0000000..979ec36 --- /dev/null +++ b/scripts/menu_date_sort.js @@ -0,0 +1,54 @@ + \ No newline at end of file