wip: unifi layouts and improve footer

This commit is contained in:
2026-01-11 00:58:53 +00:00
parent da9171686d
commit 20b1507c2b
16 changed files with 393 additions and 294 deletions

View File

@@ -1,17 +1,15 @@
---
import "../styles/global.css";
import { config } from "../config";
interface Props {
title: string;
description?: string;
version: string;
}
const { title, description, version } = Astro.props;
const defaultDescription =
"An attempt to gather a sensible selection of the most common usage " +
"patterns of git into a single and concise specification.";
const { title, description = config.description } = Astro.props;
const fullTitle = title === config.title ? title : `${title} | ${config.title}`;
const canonicalUrl = Astro.url.href;
---
<!doctype html>
@@ -19,29 +17,24 @@ const defaultDescription =
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content={description || defaultDescription} />
<meta name="author" content="Jim Myhrberg" />
<link rel="canonical" href={canonicalUrl} />
<title>{fullTitle}</title>
<meta name="description" content={description} />
<meta name="author" content={config.author} />
<!-- Open Graph -->
<meta property="og:title" content={title} />
<meta
property="og:description"
content={description || defaultDescription}
/>
<meta property="og:title" content={fullTitle} />
<meta property="og:description" content={description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={`https://commonflow.org/${version}`} />
<meta property="og:url" content={canonicalUrl} />
<!-- Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content={title} />
<meta
name="twitter:description"
content={description || defaultDescription}
/>
<meta name="twitter:title" content={fullTitle} />
<meta name="twitter:description" content={description} />
<title>{title}</title>
<!-- Fonts - distinctive choices -->
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
@@ -54,13 +47,15 @@ const defaultDescription =
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<!-- Theme initialization - prevent flash -->
<!-- Prevent flash of wrong theme -->
<script is:inline>
(function () {
const theme = localStorage.getItem("theme");
const mode = localStorage.getItem("theme");
const prefersDark =
window.matchMedia("(prefers-color-scheme: dark)").matches;
if (
theme === "dark" ||
(!theme && window.matchMedia("(prefers-color-scheme: dark)").matches)
mode === "dark" ||
(mode !== "light" && prefersDark)
) {
document.documentElement.classList.add("dark");
}
@@ -73,12 +68,10 @@ const defaultDescription =
<!-- Re-init theme on Astro page transitions -->
<script>
document.addEventListener("astro:after-swap", () => {
const theme = localStorage.getItem("theme");
if (
theme === "dark" ||
(!theme &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
const mode = localStorage.getItem("theme");
const prefersDark =
window.matchMedia("(prefers-color-scheme: dark)").matches;
if (mode === "dark" || (mode !== "light" && prefersDark)) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");

View File

@@ -1,50 +0,0 @@
---
import "../styles/global.css";
import { config } from "../config";
interface Props {
title: string;
description?: string;
}
const { title, description = config.description } = Astro.props;
const fullTitle = title === config.title ? title : `${title} | ${config.title}`;
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="canonical" href={Astro.url} />
<title>{fullTitle}</title>
<meta name="description" content={description} />
<meta name="author" content={config.author} />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap"
rel="stylesheet"
/>
<!-- Prevent flash of wrong theme -->
<script is:inline>
(function () {
const theme = localStorage.getItem("theme");
if (
theme === "dark" ||
(!theme &&
window.matchMedia("(prefers-color-scheme: dark)").matches)
) {
document.documentElement.classList.add("dark");
}
})();
</script>
</head>
<body class="min-h-screen flex flex-col items-center justify-center p-8">
<slot />
</body>
</html>