Repository navigation
Plugins: drop the pageGate field - #2797
Merged
Merged
Conversation
The registry's `pageGate` named a `.Page.Store` flag that a render hook set elsewhere: two literals kept in sync by convention, a `true` that meant "no gate", and an env override that became a flag named `false`. No plugin needs a site-settable gate in 0.18 (one gated plugin, no custom plugins), and the norm across SSGs is per-page loading decided by the theme with no switch. The loop emits every enabled plugin. Markmap's shim turns the entry off where its hook's `hasMarkmap` flag is absent (setter and reader are two files of one owner, the pattern the dispatcher uses for `hasmermaid` and `hasMath`); the legacy `params.markmap.enable` still re-enables site-wide through its cycle. A site that needs MarkMap on a page its hook didn't flag sets the flag from `hooks/head-end.html`. Tests: the gate test takes the shim shape; a head-end-clears case is added; the boolean-gate and gated-missing cases follow the field.
The MarkMap guide and the 0.18 post teach setting `hasMarkmap` from `hooks/head-end.html` where they taught `pageGate: ''`; the Plugins guide's security rule and included-content section drop the field; the design page records the decision (gating lives in the plugin's hook + shim, no registry field; `scope: site | page` is the design of record if a switch is ever asked for); the implementation page's shim contract gains the gating branch.
chalin
force-pushed
the
chalin-m24-page-gate-2026-0906
branch
from
September 7, 2026 09:37
f9ab615 to
480eca4
Compare
…the gating bullet The head-end and gated-missing tests build a hook-less twin first, so each asserts the gate before asserting the widening; a shared fixture shim replaces three copies. The MarkMap guide lists the authoring paths and says why the head hook, not the body hook. The design page's gating bullet splits into rule, why no field, and design of record.
…n page owns the contract The guide's Plugin files table gains the shim row and a task section, Adjust a plugin per page: add one for your own plugin or any of Docsy's, the gate shape as the example, and widening an existing gate by setting its flag. The Security rule points there. The implementation section keeps the ABI: resolution, call order relative to the guards, return rule, ownership, and the cleanup rule for a deprecated parameter; the "two uses" inventory goes. The design page's registry-shape and override-points items name the shim as a plugin file.
… the MarkMap guide)
The MarkMap guide no longer says markup from anywhere but the page's own content misses the hook (a .RenderShortcodes include flags the includer); the shim contract names the two guards that run after a shim instead of "every guard". Restated clauses go: the shadowing rule in the shim section, two test comments, the design page's fragment labels take the colon form, the markmap shim's header splits its nested references.
…blished flag The guide says so where it invites the shim, and the shadowing rule names shims; a 0.17 site that added the example shim for markmap otherwise lost MarkMap everywhere with no warning. The MarkMap guide states the enabled precondition and that a shadowed render hook must keep the Store.Set line. A markmap test pins the `hasMarkmap` literal the guide and the post publish (red under a consistent rename). The design page's two gating bullets merge, with the cross-generator observation homed there; the implementation page splits the shim-order sentence and drops "re-gate" for params; the lowercasing examples illustrate the point again.
…osis The guide says which two Docsy plugins have a shim to replace and what a replacement drops (gate, Prism guard, deprecated parameters), and hands the shim's ABI back to the implementation page. The MarkMap guide qualifies its loading claim as the default and notes that a custom render hook must keep Hugo's code-block markup as well as the flag; the post names the render hook, not the script, as what stopped seeing the markup. The loop's header says "enabled plugins"; the plugin table separates default and load scope with a slash.
- Implementation § Shims: state gating as the shim's contract move (return the entry with `enable` false) instead of a policy line - Markmap shim header: drop the design-rationale link; the contract link reaches it in one hop - Plugins guide: "the theme's file" link named a directory; cut the sentence that restated the shim snippet; Configure table header and description periods - markmap test: shorten the `hasMarkmap` literal comment to its pointer
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.
pageGate; the loop emits every enabled pluginpageGate: ''; the design page records the decisionscope: site | page): design of record on the design page, added on a named trigger with no migrationmarkmap_docsy-shim.html, thenplugins.html, then the two paired gate tests inplugins.test.mjs