Skip to content

Conditional pages via required_mods frontmatter - #159

Open
WhitePhant0m wants to merge 1 commit into
AppliedEnergistics:mainfrom
WhitePhant0m:conditional-pages
Open

WhitePhant0m wants to merge 1 commit into
AppliedEnergistics:mainfrom
WhitePhant0m:conditional-pages

Conversation

@WhitePhant0m

Copy link
Copy Markdown

Adds a required_mods frontmatter key that hides a page when the listed mods are missing:

---
navigation:
  title: Applied Energistics 2
required_mods:
  - ae2
  - "!ae2wtlib"
---
  • Hidden pages are dropped when pages are loaded, so they are absent from navigation, search, the item/category indices, pageExists/link resolution, and the website export.
  • ModPresence extracts the mod-id check that <OptionalSection> used; the tag delegates to it.
  • Conditions are not inherited by navigation children. Hiding a page that others list as their navigation parent removes those children from the sidebar too.
  • required_mods is parsed into the frontmatter record and stripped from the exported page frontmatter.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant