From 410f9a0560162f1876a4c2a162c397728ae96747 Mon Sep 17 00:00:00 2001 From: Nik Richers Date: Fri, 27 Mar 2026 17:11:37 -0700 Subject: [PATCH 1/5] Preview for LUA filter alternative --- .github/workflows/validate-docs-site.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-docs-site.yaml b/.github/workflows/validate-docs-site.yaml index da1d3bc9d1..ddcb04809f 100644 --- a/.github/workflows/validate-docs-site.yaml +++ b/.github/workflows/validate-docs-site.yaml @@ -50,6 +50,7 @@ jobs: with: repository: validmind/release-notes path: site/_source/release-notes + ref: nrichers/sc-15412/release-notes-filter-listing-pages-by-category token: ${{ secrets.DOCS_CI_RO_PAT }} sparse-checkout: | releases From 2f0e4817dd817a7f8faf658a8a8d4545c47a007d Mon Sep 17 00:00:00 2001 From: Nik Richers Date: Mon, 30 Mar 2026 14:49:20 -0700 Subject: [PATCH 2/5] Add category-filter Lua extension for release pages This extension reads listing-filter config from YAML frontmatter and injects it as a data attribute for the JavaScript filter to consume. --- .../category-filter/_extension.yml | 6 ++ .../category-filter/category-filter.lua | 59 +++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 site/_extensions/category-filter/_extension.yml create mode 100644 site/_extensions/category-filter/category-filter.lua diff --git a/site/_extensions/category-filter/_extension.yml b/site/_extensions/category-filter/_extension.yml new file mode 100644 index 0000000000..f12627f1d7 --- /dev/null +++ b/site/_extensions/category-filter/_extension.yml @@ -0,0 +1,6 @@ +title: Category Filter +author: Nik Richers +version: 1.0.0 +contributes: + filters: + - category-filter.lua diff --git a/site/_extensions/category-filter/category-filter.lua b/site/_extensions/category-filter/category-filter.lua new file mode 100644 index 0000000000..62fbdf5ee5 --- /dev/null +++ b/site/_extensions/category-filter/category-filter.lua @@ -0,0 +1,59 @@ +-- Category Filter Lua Extension +-- Reads listing-filter from YAML frontmatter and injects config as a data attribute + +local function meta_to_native(val) + if val == nil then + return nil + end + + local mt = getmetatable(val) + + -- Check for pandoc List type (used for YAML arrays) + if mt and mt.__name == "List" then + local arr = {} + for i, item in ipairs(val) do + arr[i] = meta_to_native(item) + end + return arr + end + + -- Check for pandoc Inlines (YAML string values become Inlines) + if mt and (mt.__name == "Inlines" or mt.__name == "Blocks") then + return pandoc.utils.stringify(val) + end + + -- Plain Lua types + local t = type(val) + if t == "string" or t == "number" or t == "boolean" then + return val + elseif t == "table" then + -- Check if it's an array-like table + if #val > 0 and val[1] ~= nil then + local arr = {} + for i, item in ipairs(val) do + arr[i] = meta_to_native(item) + end + return arr + else + -- It's a map/object + local obj = {} + for k, v in pairs(val) do + obj[k] = meta_to_native(v) + end + return obj + end + end + + -- Fallback: try stringify + return pandoc.utils.stringify(val) +end + +function Meta(meta) + if meta['listing-filter'] then + local config = meta_to_native(meta['listing-filter']) + local json = quarto.json.encode(config) + local escaped = json:gsub("'", "'") + quarto.doc.include_text("after-body", + '') + end +end From 8ab5554ab1a6367e656f00f520ffc314c49e0e7b Mon Sep 17 00:00:00 2001 From: Nik Richers Date: Mon, 30 Mar 2026 22:13:26 -0700 Subject: [PATCH 3/5] Add .quartoignore --- site/.quartoignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 site/.quartoignore diff --git a/site/.quartoignore b/site/.quartoignore new file mode 100644 index 0000000000..f91ba27b52 --- /dev/null +++ b/site/.quartoignore @@ -0,0 +1 @@ +*.Rmd \ No newline at end of file From 726730e13546905e547f7840627f95ac64bbe5b7 Mon Sep 17 00:00:00 2001 From: Nik Richers Date: Tue, 31 Mar 2026 15:42:30 -0700 Subject: [PATCH 4/5] Apply suggestion from @nrichers --- .github/workflows/validate-docs-site.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validate-docs-site.yaml b/.github/workflows/validate-docs-site.yaml index ddcb04809f..da1d3bc9d1 100644 --- a/.github/workflows/validate-docs-site.yaml +++ b/.github/workflows/validate-docs-site.yaml @@ -50,7 +50,6 @@ jobs: with: repository: validmind/release-notes path: site/_source/release-notes - ref: nrichers/sc-15412/release-notes-filter-listing-pages-by-category token: ${{ secrets.DOCS_CI_RO_PAT }} sparse-checkout: | releases From 3f040c3a77b58f59e0aa1a9b4d8688a707a8a177 Mon Sep 17 00:00:00 2001 From: Nik Richers Date: Tue, 31 Mar 2026 15:45:35 -0700 Subject: [PATCH 5/5] Wildcard paths for .Rmd .quartoignore --- site/.quartoignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/.quartoignore b/site/.quartoignore index f91ba27b52..cdef88f3fe 100644 --- a/site/.quartoignore +++ b/site/.quartoignore @@ -1 +1 @@ -*.Rmd \ No newline at end of file +**/*.Rmd \ No newline at end of file