Skip to content

Preview for filter by category LUA filter alternative + add category-filter extension to repo#1255

Merged
nrichers merged 6 commits intomainfrom
nrichers/sc-15412/release-notes-filter-listing-pages-by-category
Mar 31, 2026
Merged

Preview for filter by category LUA filter alternative + add category-filter extension to repo#1255
nrichers merged 6 commits intomainfrom
nrichers/sc-15412/release-notes-filter-listing-pages-by-category

Conversation

@nrichers
Copy link
Copy Markdown
Collaborator

@nrichers nrichers commented Mar 28, 2026

Pull Request Description

What and why?

Preview for LUA filter alternative + Add the category-filter extension to the repo so it is available during docs builds.

How to test

What needs special review?

Dependencies, breaking changes, and deployment notes

Release notes

Checklist

  • What and why
  • Screenshots or videos (Frontend)
  • How to test
  • What needs special review
  • Dependencies, breaking changes, and deployment notes
  • Labels applied
  • PR linked to Shortcut
  • Unit tests added (Backend)
  • Tested locally
  • Documentation updated (if required)
  • Environment variable additions/changes documented (if required)

@nrichers nrichers added the internal Not to be externalized in the release notes label Mar 28, 2026
@nrichers nrichers changed the title Preview for LUA filter alternative Preview — Filter by category LUA filter alternative Mar 28, 2026
@nrichers nrichers changed the title Preview — Filter by category LUA filter alternative Preview for filter by category LUA filter alternative Mar 30, 2026
This extension reads listing-filter config from YAML frontmatter and
injects it as a data attribute for the JavaScript filter to consume.
@nrichers nrichers changed the title Preview for filter by category LUA filter alternative Preview for filter by category LUA filter alternative + add category-filter extension to repo Mar 30, 2026
@nrichers nrichers requested a review from validbeck March 30, 2026 22:24
Copy link
Copy Markdown
Collaborator

@validbeck validbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many PRs, got confused. I get why the filter doesn't work now for my other preview.

…-category' of github.com:validmind/documentation into nrichers/sc-15412/release-notes-filter-listing-pages-by-category
@nrichers nrichers merged commit 560ac76 into main Mar 31, 2026
7 checks passed
@nrichers nrichers deleted the nrichers/sc-15412/release-notes-filter-listing-pages-by-category branch March 31, 2026 22:46
@github-actions
Copy link
Copy Markdown
Contributor

PR Summary

This PR introduces a new category filter extension designed for integrating configuration data from the YAML frontmatter of documents into the rendered HTML. Specifically, the extension reads a property called listing-filter from the metadata, converts it into native Lua types using the helper function meta_to_native, and encodes the result to JSON. It then escapes single quotes and injects the JSON configuration into a hidden <div> element on the page. This enables client-side scripts to access and utilize the configuration for filtering listings on the site.

Key functional changes include:

  • Addition of a .quartoignore rule to exclude certain file patterns (e.g., **/*.Rmd).
  • A new extension descriptor file (_extension.yml) that registers the extension with its title, author, version, and contribution details.
  • Implementation of the meta_to_native function which recursively converts the YAML-frontmatter values to Lua native types, handling cases such as arrays and text blocks.
  • The main Meta function that checks if the listing-filter metadata is present, encodes it as JSON, escapes problematic characters, and injects the configuration into the HTML output via an "after-body" file inclusion.

Test Suggestions

  • Verify that when a valid 'listing-filter' is provided, the JSON configuration is correctly injected into the HTML without errors.
  • Test the behavior when 'listing-filter' is absent to ensure no extraneous hidden div is created.
  • Create unit tests for the meta_to_native function with a variety of data types (e.g., string, number, boolean, arrays, nested objects) including empty or nil cases.
  • Ensure proper escaping of single quotes in the JSON output to prevent issues in HTML rendering.
  • Simulate frontmatter containing pandoc List, Inlines, and Blocks types to verify proper conversion to native values.

@github-actions
Copy link
Copy Markdown
Contributor

Validate docs site

✓ INFO: A live preview of the docs site is available — Open the preview

@github-actions
Copy link
Copy Markdown
Contributor

Lighthouse check results

⚠️ WARN: Average accessibility score is 0.87 (required: >0.9) — Check the workflow run

Show Lighthouse scores

Folder depth level checked: 0

Commit SHA: c7cb5d1

Modify the workflow to check a different depth:

  • 0: Top-level navigation only — /index.html, /guide/guides.html, ...
  • 1: All first-level subdirectories — /guide/.html, /developer/.html, ...
  • 2: All second-level subdirectories — /guide/attestation/*.html, ...
Page Accessibility Performance Best Practices SEO
/developer/validmind-library.html 0.85 0.69 1.00 0.82
/get-started/get-started.html 0.85 0.72 1.00 0.73
/guide/guides.html 0.81 0.71 1.00 0.82
/index.html 0.93 0.67 1.00 0.82
/releases/all-releases.html 0.86 0.69 1.00 0.73
/support/support.html 0.91 0.68 1.00 0.82
/training/training.html 0.85 0.63 0.96 0.73

@nrichers nrichers restored the nrichers/sc-15412/release-notes-filter-listing-pages-by-category branch April 1, 2026 00:29
@nrichers nrichers deleted the nrichers/sc-15412/release-notes-filter-listing-pages-by-category branch April 1, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants