From 92d28ab31bdc9831bbcd42e569c25100705d9397 Mon Sep 17 00:00:00 2001 From: calixteman Date: Mon, 5 Oct 2026 18:11:20 +0200 Subject: [PATCH] Replace Metalsmith with a `docs` gulp task Render the four Markdown pages with Marked and Highlight.js, using a JavaScript template instead of Nunjucks. Preserve their heading IDs and relative URLs. Add `lint-docs` to `gulp lint` to check Markdown tokens, front matter keys, code languages, and remaining root-relative URLs in selected HTML attributes. Verified all four pages against the old Metalsmith output: parsed HTML matches after ignoring whitespace between elements. --- docs/contents/api/index.md | 1 - docs/contents/examples/index.md | 1 - docs/contents/getting_started/index.md | 1 - docs/contents/index.md | 1 - docs/templates/{layout.njk => layout.js} | 17 +- gulpfile.mjs | 193 +++++++++--- package-lock.json | 376 ++--------------------- package.json | 6 +- 8 files changed, 170 insertions(+), 426 deletions(-) rename docs/templates/{layout.njk => layout.js} (79%) diff --git a/docs/contents/api/index.md b/docs/contents/api/index.md index 0c64ea811..d0484f2e1 100644 --- a/docs/contents/api/index.md +++ b/docs/contents/api/index.md @@ -1,6 +1,5 @@ --- title: API -layout: layout.njk slug: api --- diff --git a/docs/contents/examples/index.md b/docs/contents/examples/index.md index 36d674153..8d83a3662 100644 --- a/docs/contents/examples/index.md +++ b/docs/contents/examples/index.md @@ -1,6 +1,5 @@ --- title: Examples -layout: layout.njk slug: examples --- diff --git a/docs/contents/getting_started/index.md b/docs/contents/getting_started/index.md index 438702b24..a5198170c 100644 --- a/docs/contents/getting_started/index.md +++ b/docs/contents/getting_started/index.md @@ -1,6 +1,5 @@ --- title: Getting Started -layout: layout.njk slug: getting_started --- diff --git a/docs/contents/index.md b/docs/contents/index.md index 103741486..4d59a471c 100644 --- a/docs/contents/index.md +++ b/docs/contents/index.md @@ -1,6 +1,5 @@ --- title: Home -layout: layout.njk slug: home --- diff --git a/docs/templates/layout.njk b/docs/templates/layout.js similarity index 79% rename from docs/templates/layout.njk rename to docs/templates/layout.js index d0dd02084..791fd08e8 100644 --- a/docs/templates/layout.njk +++ b/docs/templates/layout.js @@ -1,9 +1,9 @@ - +export default ({ contents, description, sitename, slug, title }) => ` - {{ sitename }} - {{ title }} + ${sitename} - ${title} - + @@ -22,16 +22,16 @@