From 7a2019ce70867a851bf86f893397f99f6d9ca84f Mon Sep 17 00:00:00 2001 From: Said-MZ Date: Mon, 13 Jul 2026 22:34:28 +0300 Subject: [PATCH 1/4] fix(dev): keep the CSS watcher alive under Foreman Tailwind's --watch stops as soon as stdin closes, which Foreman does immediately for spawned processes, so `mise run dev` exited the whole process group right after boot. --watch=always keeps it running regardless of stdin. --- Procfile.dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile.dev b/Procfile.dev index c1cb248..02aaaf3 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,3 +1,3 @@ web: env RUBY_DEBUG_OPEN=true bin/rails server js: yarn build --watch -css: yarn build:css --watch +css: yarn build:css --watch=always From 99ae7172cad2e31a2e12b27f4b8fb1ed10d8da52 Mon Sep 17 00:00:00 2001 From: Said-MZ Date: Mon, 13 Jul 2026 22:34:36 +0300 Subject: [PATCH 2/4] feat(markdown): support YAML front matter in Markdown uploads Parse a leading --- delimited YAML block off Markdown uploads before rendering. `title` overrides the H1/filename fallback for the page , and `description` renders as a meta description tag. Malformed or non-mapping front matter (or none at all) falls back to treating the whole file as plain Markdown body, so nothing breaks rendering. --- app/models/markdown_document.rb | 40 +++++++++++++++--- test/models/markdown_document_test.rb | 58 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/app/models/markdown_document.rb b/app/models/markdown_document.rb index 18c586e..4c3f522 100644 --- a/app/models/markdown_document.rb +++ b/app/models/markdown_document.rb @@ -18,6 +18,10 @@ class MarkdownDocument autolink: true, tasklist: true, footnotes: true }.freeze + # A leading `---` block of YAML, terminated by another `---` line. Common to + # every static-site generator's Markdown dialect (Jekyll, Hugo, Astro, ...). + FRONT_MATTER_PATTERN = /\A---[ \t]*\r?\n(.*?)\r?\n---[ \t]*\r?\n?(.*)\z/m + # Pinned so a stored paste renders identically forever. The ESM build boots # itself via startOnLoad and upgrades every <pre class="mermaid">. MERMAID_MODULE = "https://cdn.jsdelivr.net/npm/mermaid@11.4.1/dist/mermaid.esm.min.mjs".freeze @@ -67,7 +71,7 @@ class MarkdownDocument CSS def initialize(markdown, filename: nil) - @markdown = markdown.to_s + @front_matter, @markdown = self.class.split_front_matter(markdown.to_s) @filename = filename.to_s end @@ -81,7 +85,7 @@ def to_html <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>#{CGI.escapeHTML(document_title)} - + #{description_meta_tag}