Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

# misc
.DS_Store
.idea/

# generated
.astro/
Expand Down
13 changes: 12 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/')
})
]
});
4 changes: 4 additions & 0 deletions src/components/InlineEditor.astro
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
4 changes: 4 additions & 0 deletions src/components/Principle.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
interface Props {
name: string;
}

const { name } = Astro.props;
---

Expand Down
13 changes: 11 additions & 2 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -32,7 +35,13 @@ import '../styles/global.css';
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title}</title>
<meta name="description" content={description} />
<link rel="canonical" href={canonicalURL} />
{
noindex ? (
<meta name="robots" content="noindex, follow" />
) : (
<link rel="canonical" href={canonicalURL} />
)
}
<link href="/favicon.png" rel="icon">
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions src/pages/404.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Layout from '../layouts/Layout.astro';
<Layout
title="Flix | Page Not Found"
description="The page you are looking for does not exist. Head back to the front page or explore the Flix documentation."
noindex
>
<div class="container">
<div class="row mb-3">
Expand Down
1 change: 1 addition & 0 deletions src/pages/blog.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Layout from '../layouts/Layout.astro';
<Layout
title="Flix | Blog"
description="The Flix blog has moved to blog.flix.dev, where we write about programming languages, language design, compilers, and type and effect systems."
noindex
>
<div class="container">
<div class="row mb-3">
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "astro/tsconfigs/base",
"extends": "astro/tsconfigs/strict",
"include": [".astro/types.d.ts", "**/*"],
"exclude": ["dist"]
}