diff --git a/.gitignore b/.gitignore index 5e1be22..194e522 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # misc .DS_Store +.idea/ # generated .astro/ diff --git a/astro.config.mjs b/astro.config.mjs index a181bd4..077fe04 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,5 +5,16 @@ import sitemap from '@astrojs/sitemap'; export default defineConfig({ site: 'https://flix.dev', - integrations: [icon(), sitemap()] + // Prefetch every internal link on hover; the nav links to nine pages. + prefetch: { + prefetchAll: true + }, + integrations: [ + icon(), + // /blog is a stub pointing at blog.flix.dev and is marked noindex, so it + // does not belong in the sitemap either. + sitemap({ + filter: (page) => !page.endsWith('/blog/') + }) + ] }); diff --git a/src/components/InlineEditor.astro b/src/components/InlineEditor.astro index c4f760b..906072f 100644 --- a/src/components/InlineEditor.astro +++ b/src/components/InlineEditor.astro @@ -1,6 +1,10 @@ --- import { Code } from "astro:components"; import lightPlus from "@shikijs/themes/light-plus"; +interface Props { + code: string; +} + const { code } = Astro.props; import flixGrammar from "../grammars/flix.tmLanguage.json"; diff --git a/src/components/Principle.astro b/src/components/Principle.astro index d0bb9de..10bdd6d 100644 --- a/src/components/Principle.astro +++ b/src/components/Principle.astro @@ -1,4 +1,8 @@ --- +interface Props { + name: string; +} + const { name } = Astro.props; --- diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b3cd156..596c09d 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -5,9 +5,12 @@ import '@fontsource/open-sans/400.css'; interface Props { title: string; description: string; + /** Keep the page out of the index. Also drops the canonical link, which a + non-indexable page should not claim. */ + noindex?: boolean; } -const { title, description } = Astro.props; +const { title, description, noindex = false } = Astro.props; const currentPath = Astro.url.pathname; const canonicalURL = new URL(currentPath, Astro.site); @@ -32,7 +35,13 @@ import '../styles/global.css'; {title} - + { + noindex ? ( + + ) : ( + + ) + } diff --git a/src/pages/404.astro b/src/pages/404.astro index 981c861..fde6d59 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -4,6 +4,7 @@ import Layout from '../layouts/Layout.astro';
diff --git a/src/pages/blog.astro b/src/pages/blog.astro index c2dda60..c1f0fe2 100644 --- a/src/pages/blog.astro +++ b/src/pages/blog.astro @@ -4,6 +4,7 @@ import Layout from '../layouts/Layout.astro';
diff --git a/tsconfig.json b/tsconfig.json index f11a46c..8bf91d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "astro/tsconfigs/base", + "extends": "astro/tsconfigs/strict", "include": [".astro/types.d.ts", "**/*"], "exclude": ["dist"] }