diff --git a/.changeset/tame-tips-rush.md b/.changeset/tame-tips-rush.md new file mode 100644 index 00000000..5421bc29 --- /dev/null +++ b/.changeset/tame-tips-rush.md @@ -0,0 +1,6 @@ +--- +'@myst-theme/article': patch +'@myst-theme/book': patch +--- + +Per page options for the site diff --git a/themes/article/app/components/ArticlePage.tsx b/themes/article/app/components/ArticlePage.tsx index cb1ceab6..f9899e19 100644 --- a/themes/article/app/components/ArticlePage.tsx +++ b/themes/article/app/components/ArticlePage.tsx @@ -1,9 +1,5 @@ import type { PageLoader } from '@myst-theme/common'; -import { - FooterLinksBlock, - ArticleHeader, - Error404, -} from '@myst-theme/site'; +import { FooterLinksBlock, ArticleHeader, Error404 } from '@myst-theme/site'; import { LaunchBinder, useComputeOptions } from '@myst-theme/jupyter'; import { ArrowLeftIcon } from '@heroicons/react/24/outline'; import { DocumentArrowDownIcon } from '@heroicons/react/24/outline'; @@ -25,7 +21,7 @@ export function ArticlePage({ article }: { article: PageLoader }) { const grid = useGridSystemProvider(); const siteManifest = useSiteManifest() as SiteManifest; - const pageDesign: TemplateOptions = (article.frontmatter as any)?.options ?? {}; + const pageDesign: TemplateOptions = (article.frontmatter as any)?.site ?? {}; const siteDesign: TemplateOptions = siteManifest?.options ?? {}; const { projects } = siteManifest; @@ -112,4 +108,3 @@ export function ArticlePage({ article }: { article: PageLoader }) { ); } - diff --git a/themes/book/app/components/ArticlePage.tsx b/themes/book/app/components/ArticlePage.tsx index 4438ff78..b50a303c 100644 --- a/themes/book/app/components/ArticlePage.tsx +++ b/themes/book/app/components/ArticlePage.tsx @@ -64,7 +64,7 @@ export const ArticlePage = React.memo(function ({ const compute = useComputeOptions(); const top = useThemeTop(); - const pageDesign: TemplateOptions = (article.frontmatter as any)?.options ?? {}; + const pageDesign: TemplateOptions = (article.frontmatter as any)?.site ?? {}; const siteDesign: TemplateOptions = (useSiteManifest() as SiteManifest & TemplateOptions)?.options ?? {}; const { hide_title_block, hide_footer_links, hide_outline, outline_maxdepth } = { diff --git a/themes/book/app/routes/$.tsx b/themes/book/app/routes/$.tsx index adab7dfa..be0b804e 100644 --- a/themes/book/app/routes/$.tsx +++ b/themes/book/app/routes/$.tsx @@ -136,7 +136,7 @@ export default function Page() { const { container } = useOutlineHeight(); const data = useLoaderData() as { page: PageLoader; project: ManifestProject }; const baseurl = useBaseurl(); - const pageDesign: TemplateOptions = (data.page.frontmatter as any)?.options ?? {}; + const pageDesign: TemplateOptions = (data.page.frontmatter as any)?.site ?? {}; const siteDesign: TemplateOptions = (useSiteManifest() as SiteManifest & TemplateOptions)?.options ?? {}; const { hide_toc, hide_footer_links } = {