diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index ae54951..fc1114e 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -24,6 +24,9 @@ interface Props { tags?: string[]; category?: string; }; + // Error pages: emit noindex and skip the canonical (a canonical pointing at a + // page that does not exist is worse than none). + noindex?: boolean; } const { @@ -35,6 +38,7 @@ const { switchHref, altLocaleUrl, article, + noindex = false, } = Astro.props; const canonical = new URL(Astro.url.pathname, SITE.url).href; @@ -71,7 +75,7 @@ const nav = isZh