feat: Add validity support for CMS + bug fixes - #1156
Open
MoritzWeber0 wants to merge 7 commits into
Open
Conversation
✅ Deploy Preview for fipguide ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi there! 👋 Thank you for your contribution to the FIP Guide! 🚀 Checklist before merging:
|
- Add fip-validity-select and fip-validity-link custom Decap widgets, and a new FIP Validity Tables collection for editing the groups and operators data in each issuer's validity.yaml - Filter validity dropdowns by group type (FIP Coupon vs Reduced Ticket); sort the operators map alphabetically on save - Allow creating new FIP Validity Table entries via Decap's meta.path mechanism, and link to the matching table from the FIP Application page's fip-validity-table shortcode - Rename fip-validity-widget.js to widget.js - Generate the Operators field list in the admin config from content/operator via a Hugo-templated layouts/admin/section.cmsconfig.yml instead of a hand-maintained list in static/admin/config.yml - Exclude the new template from the check-yaml pre-commit hook via prek's glob exclude syntax, since it's Go template source, not plain YAML - Re-save validity.yaml files through the CMS to backfill the new type field on existing validity groups
Set hide: true on the fip-validity collection so it no longer appears in the sidebar nav or as the default landing collection, while staying fully reachable via the FIP Application shortcode's direct link and its own entry URLs.
- Only emit local_backend: true when hugo.IsServer is true, so it never appears in production/preview builds, only local dev - Derive the Decap backend branch from a FIPGUIDE_BRANCH env var instead of hardcoding main, falling back to main when unset - Whitelist the FIPGUIDE_ prefix in hugo.yaml's security.funcs.getenv, since os.Getenv is deny-by-default for anything outside HUGO_/CI - Populate FIPGUIDE_BRANCH from Netlify's own in the build command, and from github.ref_name in the Pages deploy workflow
highlight and highlight-raw were both registered with the identical
bracket-agnostic pattern shortcodePattern("highlight"), which matches
either {{% %}} or {{< >}} syntax. Decap's markdown parser tries every
globally registered editor component's pattern (not just the ones
listed in a field's own editor_components) and picks whichever
matches first via Immutable Map iteration, whose order isn't
guaranteed to follow registration order. That let a {{% highlight %}}
block get mistakenly tagged as highlight-raw on parse, which then
serialized back out as {{< highlight >}} on save.
shortcodePattern now takes an optional bracket argument so highlight
only matches %-delimited shortcodes and highlight-raw only matches
<-delimited ones, making the two mutually exclusive. Existing callers
that omit the argument keep the original bracket-agnostic behavior.
MoritzWeber0
marked this pull request as ready for review
August 16, 2026 18:22
Netlify's $BRANCH is documented as the git ref checked out for the build, not necessarily a plain branch name. For PR-triggered deploy previews it can resolve to a checkout ref like pull/1156/head, which isn't a real branch Decap's GitHub backend can point to. $HEAD is documented as the actual head branch name from the Git provider, so use that instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for editing the FIP validity table in the CMS, groups are no longer defined as YAML anchor, but as normal keys in the YAML itself.
Auto-enable
local_backendwhen running locally (it detects a runningnpx decap-serverserver), see https://decapcms.org/docs/decap-proxy/Add support for targeting different branches (edit page on the preview uses the correct branch, not main)
Update the highlight syntax again to avoid page modifications
Resolves #919