From 14773e454826255840e9ea6b451b45fce4c0aaba Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Tue, 14 Nov 2023 10:25:21 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A9=E2=80=8D=F0=9F=8E=A8=20Get=20desig?= =?UTF-8?q?n=20fields=20directly=20from=20options=20(#261)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/stupid-socks-report.md | 7 +++++++ packages/site/src/pages/Article.tsx | 2 +- themes/article/app/routes/$.tsx | 2 +- themes/book/app/routes/$.tsx | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changeset/stupid-socks-report.md diff --git a/.changeset/stupid-socks-report.md b/.changeset/stupid-socks-report.md new file mode 100644 index 000000000..3ca9fefae --- /dev/null +++ b/.changeset/stupid-socks-report.md @@ -0,0 +1,7 @@ +--- +'@myst-theme/article': patch +'@myst-theme/site': patch +'@myst-theme/book': patch +--- + +Get design fields from options diff --git a/packages/site/src/pages/Article.tsx b/packages/site/src/pages/Article.tsx index d62ae9ed3..45aa96077 100644 --- a/packages/site/src/pages/Article.tsx +++ b/packages/site/src/pages/Article.tsx @@ -35,7 +35,7 @@ export const ArticlePage = React.memo(function ({ }) { const canCompute = useCanCompute(); - const { hide_title_block, hide_footer_links } = (article.frontmatter as any)?.design ?? {}; + const { hide_title_block, hide_footer_links } = (article.frontmatter as any)?.options ?? {}; const tree = copyNode(article.mdast); const keywords = article.frontmatter?.keywords ?? []; diff --git a/themes/article/app/routes/$.tsx b/themes/article/app/routes/$.tsx index 3e4cc9585..437c9f08e 100644 --- a/themes/article/app/routes/$.tsx +++ b/themes/article/app/routes/$.tsx @@ -248,7 +248,7 @@ export function ArticlePage({ article }: { article: PageLoader }) { export default function Page() { // const { container, outline } = useOutlineHeight(); const article = useLoaderData() as PageLoader; - const { hide_outline } = (article.frontmatter as any)?.design ?? {}; + const { hide_outline } = (article.frontmatter as any)?.options ?? {}; return ( diff --git a/themes/book/app/routes/$.tsx b/themes/book/app/routes/$.tsx index 2a455b4cc..ff237a0dd 100644 --- a/themes/book/app/routes/$.tsx +++ b/themes/book/app/routes/$.tsx @@ -96,9 +96,9 @@ export default function Page() { const { container, outline } = useOutlineHeight(); const top = useThemeTop(); const article = useLoaderData() as PageLoader; - const pageDesign: BookThemeTemplateOptions = (article.frontmatter as any)?.design ?? {}; + const pageDesign: BookThemeTemplateOptions = (article.frontmatter as any)?.options ?? {}; const siteDesign: BookThemeTemplateOptions = - (useSiteManifest() as SiteManifest & BookThemeTemplateOptions) ?? {}; + (useSiteManifest() as SiteManifest & BookThemeTemplateOptions)?.options ?? {}; const { hide_toc, hide_outline, hide_footer_links } = { ...siteDesign, ...pageDesign }; return (