You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found while building Phases 4–5 (#90, #91). The MyST CLI validates site.options against the template's declared options and drops every key the template does not declare (validateTemplateOptions in myst-templates: the output object is built only from the declared definitions; unknown keys log at debug level). Until #90's branch, this theme's template.yml declared no options at all, so config.options arrived as {} on every site. Verified on the visual fixture, whose site.options.logo_text never appears in _build/site/config.json.
That means several options the theme reads have never worked from myst.yml:
Page-level site: frontmatter is a different path. The CLI validates it with the same definitions but, when the validated result is empty, leaves the page's raw site: block in place. That is the only reason site.git_metadata works on the fixture's features page and in the git-metadata plugin's override. Two consequences worth knowing:
A page that sets any declared key under site: has its whole block replaced by the validated keys, so an undeclared git_metadata on that page is silently lost. Phase 4 — Internationalisation (language switcher + hreflang) #90's branch documents this in app/types.ts and keeps the two on different fixture pages.
A declared option's default: is written into every page's validated block even when the page set nothing, which then overrides the site-wide value. Phase 4 — Internationalisation (language switcher + hreflang) #90's branch therefore declares no defaults in template.yml and applies them in code.
Proposed fix. Declare in template.yml every option the theme reads, one options: entry each (twitter, the five launch_*, favicon as type file, the two analytics_*, the hide_* / outline_maxdepth set), with no default: values, and add a fixture assertion that a declared option reaches config.options. Then decide what to do about git_metadata: it is an object, which a template option cannot declare, so the page-level override survives only by the empty-validation quirk above. Moving the page-level override to mdast.data (where the plugin already writes) would take it off that path.
Options that cannot be declared. Template option types are boolean, string, number, choice and file only. Any structured option has to be a string (#90 uses a YAML block string for languages and translators) or live somewhere the CLI preserves. A real list / object option type in the engine would remove the workaround; that is a QuantEcon/mystmd (and upstream) change, not a theme one, and is noted on the upstream-candidates ledger.
Found while building Phases 4–5 (#90, #91). The MyST CLI validates
site.optionsagainst the template's declared options and drops every key the template does not declare (validateTemplateOptionsin myst-templates: the output object is built only from the declared definitions; unknown keys log at debug level). Until #90's branch, this theme'stemplate.ymldeclared no options at all, soconfig.optionsarrived as{}on every site. Verified on the visual fixture, whosesite.options.logo_textnever appears in_build/site/config.json.That means several options the theme reads have never worked from
myst.yml:app/root.tsx, both page routestwitterapp/components/toolbar/LaunchButton.tsxlaunch_repo_url,launch_repo_suffix,launch_branch,launch_notebooks_path,launch_source_pathlaunchUrls.tsis unreachable from configapp/backend/loaders.server.tsfaviconapp/components/Document.tsx(upstream shape)analytics_google,analytics_plausibleapp/components/Page.tsxhide_toc,hide_search,hide_outline,hide_title_block,outline_maxdepth,hide_footer_linkslogo_textPage-level
site:frontmatter is a different path. The CLI validates it with the same definitions but, when the validated result is empty, leaves the page's rawsite:block in place. That is the only reasonsite.git_metadataworks on the fixture's features page and in the git-metadata plugin's override. Two consequences worth knowing:site:has its whole block replaced by the validated keys, so an undeclaredgit_metadataon that page is silently lost. Phase 4 — Internationalisation (language switcher + hreflang) #90's branch documents this inapp/types.tsand keeps the two on different fixture pages.default:is written into every page's validated block even when the page set nothing, which then overrides the site-wide value. Phase 4 — Internationalisation (language switcher + hreflang) #90's branch therefore declares no defaults intemplate.ymland applies them in code.Proposed fix. Declare in
template.ymlevery option the theme reads, oneoptions:entry each (twitter, the fivelaunch_*,faviconas typefile, the twoanalytics_*, thehide_*/outline_maxdepthset), with nodefault:values, and add a fixture assertion that a declared option reachesconfig.options. Then decide what to do aboutgit_metadata: it is an object, which a template option cannot declare, so the page-level override survives only by the empty-validation quirk above. Moving the page-level override tomdast.data(where the plugin already writes) would take it off that path.Options that cannot be declared. Template option types are
boolean,string,number,choiceandfileonly. Any structured option has to be a string (#90 uses a YAML block string forlanguagesandtranslators) or live somewhere the CLI preserves. A reallist/objectoption type in the engine would remove the workaround; that is a QuantEcon/mystmd (and upstream) change, not a theme one, and is noted on the upstream-candidates ledger.