This commit is contained in:
Andras Schmelczer 2026-06-06 21:03:26 +01:00
parent fcb0e25ebd
commit 3441a7e4af
108 changed files with 641 additions and 869 deletions

View file

@ -7,14 +7,15 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import { visit } from 'unist-util-visit';
// Build a lookup of post slugs to their last modification dates so the sitemap
// can advertise accurate <lastmod> values to crawlers. astro:content isn't
// available inside the config, so we read post frontmatter directly. Our posts
// always use single-line scalar `date:` / `updated:` keys, so a small regex
// extraction is sufficient and intentional.
// Build a lookup of article slugs to their last modification dates so the
// sitemap can advertise accurate <lastmod> values to crawlers. astro:content
// isn't available inside the config, so we read entry frontmatter directly.
// Each entry uses a single-line top-level scalar `date:` key, so a small regex
// extraction is sufficient and intentional. (`updated:` now lives nested under
// `article:`; no entry sets it, so falling back to `date` is correct.)
const postsDir = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
'src/content/posts'
'src/content/work'
);
function extractScalar(frontmatter, key) {