Astro garden skeleton: Quartz-compatible URLs, Obsidian markdown, odometer homepage

- glob content loader over the vault's Digital_Garden with verbatim-path ids
- remark plugin: wikilinks, image embeds (wiki + relative md), callouts
- URL parity with live Quartz sitemap verified 102/102 (built set is a
  strict superset: +30 synthetic folder listings)
- KaTeX, lazy mermaid, shiki dual themes, quoted-string draft handling
- copy-assets resolves embeds vault-wide (fixes live-site 404s for
  Blog Scratch/assets images) into flat /assets/
- homepage odometer widget: fetches api.c0smere.net baseline, ticks at
  lifetime average rate, fail-closed hidden on error
- deploy/: nginx try_files config + compose (port 18100) + containerized
  build script for cyrion

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wes
2026-07-15 14:18:59 -04:00
co-authored by Claude Opus 4.8
commit 04c9aa2fb2
15 changed files with 7527 additions and 0 deletions
+167
View File
@@ -0,0 +1,167 @@
---
import 'katex/dist/katex.min.css';
interface Props {
title: string;
description?: string;
}
const { title, description } = Astro.props;
const isHome = Astro.url.pathname === '/';
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{title}{isHome ? '' : ' // Wesley Ray'}</title>
{description && <meta name="description" content={description} />}
<script
defer
data-domain="garden.c0smere.net"
src="https://plausible.io/js/script.js"></script>
</head>
<body>
<header>
{!isHome && <nav><a href="/">← home</a></nav>}
</header>
<main>
<slot />
</main>
<footer>
<p>
Wesley Ray · <a href="https://blog.c0smere.net">blog</a> ·
<a href="https://git.c0smere.net/wes">git</a> ·
<a href="https://resume.c0smere.net">resume</a>
</p>
</footer>
<script>
// mermaid: only load the (large) module on pages that need it
const blocks = document.querySelectorAll('pre > code.language-mermaid');
if (blocks.length) {
const { default: mermaid } = await import('mermaid');
blocks.forEach((code) => {
const pre = document.createElement('pre');
pre.className = 'mermaid';
pre.textContent = code.textContent ?? '';
code.parentElement?.replaceWith(pre);
});
mermaid.initialize({
startOnLoad: false,
theme: matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'default',
});
await mermaid.run();
}
</script>
<style is:global>
:root {
--bg: #faf8f8;
--fg: #2b2b2b;
--muted: #4e4e4e;
--faint: #e5e5e5;
--accent: #284b63;
--accent2: #84a59d;
color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
:root {
--bg: #161618;
--fg: #ebebec;
--muted: #d4d4d4;
--faint: #393639;
--accent: #7b97aa;
--accent2: #84a59d;
}
}
* {
box-sizing: border-box;
}
body {
margin: 0 auto;
padding: 1.5rem 1rem 3rem;
max-width: 44rem;
background: var(--bg);
color: var(--fg);
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
line-height: 1.6;
}
a {
color: var(--accent);
}
h1, h2, h3, h4 {
line-height: 1.25;
}
header nav {
margin-bottom: 1rem;
font-size: 0.9rem;
}
footer {
margin-top: 3rem;
padding-top: 1rem;
border-top: 1px solid var(--faint);
font-size: 0.85rem;
color: var(--muted);
}
img {
max-width: 100%;
height: auto;
}
pre {
padding: 0.9rem 1rem;
border-radius: 6px;
overflow-x: auto;
font-size: 0.88rem;
}
:not(pre) > code {
background: var(--faint);
padding: 0.1em 0.35em;
border-radius: 4px;
font-size: 0.9em;
}
table {
border-collapse: collapse;
display: block;
overflow-x: auto;
max-width: 100%;
}
th, td {
border: 1px solid var(--faint);
padding: 0.35rem 0.6rem;
}
blockquote {
margin: 1rem 0;
padding: 0.1rem 1rem;
border-left: 3px solid var(--accent2);
color: var(--muted);
}
.callout {
border-left-width: 4px;
border-radius: 4px;
background: color-mix(in srgb, var(--accent2) 8%, transparent);
}
.callout-title {
color: var(--accent);
}
.callout-warning, .callout-attention, .callout-important {
border-left-color: #c9803a;
}
.callout-warning .callout-title,
.callout-attention .callout-title,
.callout-important .callout-title {
color: #c9803a;
}
/* dark-mode-aware shiki dual themes */
@media (prefers-color-scheme: dark) {
.astro-code,
.astro-code span {
color: var(--shiki-dark) !important;
background-color: var(--shiki-dark-bg) !important;
}
}
</style>
</body>
</html>