From 10d0ab6529e79996745a301ec4e54b6c4c1a7ccf Mon Sep 17 00:00:00 2001 From: Calic Date: Thu, 11 Jun 2026 02:39:01 +0200 Subject: [PATCH] feat(launcher): render news.md in detail panel for news entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static 'coming soon' stub authored as Markdown with JSON-frontmatter title. Loaded once on init, parsed via the same fm + md helpers as modules. Live news (Gitea-API or RSS) deferred — single-source-of- truth in the launcher repo keeps update-pace under our control. --- init.lua | 19 +++++++++++++++++++ news.md | 22 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 news.md diff --git a/init.lua b/init.lua index f44b726..93c9ef0 100644 --- a/init.lua +++ b/init.lua @@ -268,6 +268,25 @@ function init(ctx) ctx_panels.carousel_state[entry.id] = carousel.new_state(entry.id, paths, interval) end + -- L.6: load + parse news.md once. The detail-panel's news branch + -- reads ctx.news_body_blocks; nil-safe so a missing file still + -- shows the "News" entry with an empty body. + do + local news_path = MODULE_DIR .. "/news.md" + local f = io.open(news_path, "rb") + if f then + local content = f:read("*a") + f:close() + local fm = dofile(MODULE_DIR .. "/frontmatter.lua") + local md = dofile(MODULE_DIR .. "/markdown.lua") + local meta, body = fm.parse(content) + if meta then + ctx_panels.news_entry.title = meta.title or "News" + ctx_panels.news_body_blocks = md.parse(body) + end + end + end + local wy, hy = engine.render.measure_text(YES_LABEL, FONT_BUTTON) local wn, hn = engine.render.measure_text(NO_LABEL, FONT_BUTTON) local qbtn_w = math.max(wy, wn) + 2 * PAD_X diff --git a/news.md b/news.md new file mode 100644 index 0000000..81d2e63 --- /dev/null +++ b/news.md @@ -0,0 +1,22 @@ +--- +{"title":"News","published":"2026-06-11"} +--- + +# Sporel News + +## Coming soon + +Live news will eventually appear here — release notes, mod-of-the-week, +known-issue advisories. For now this is a static stub. + +## What works today + +- Master-detail launcher with per-module description + dep-status +- Hero carousel with auto-rotate +- Dep-conflict ambient-tint + launch-modal + +## What we are working on next + +- Live news source (Gitea-API or RSS-feed) +- Module-categories filter (Game / Tool / Test) +- Last-played persistence