Hello world
A placeholder essay that keeps the writing collection typed and the build honest. Replace it with the first thing you actually want to say.
Every collection keeps one example entry so its schema stays exercised and the site still builds on a clean checkout. Delete this file once you have real writing to publish.
Frontmatter is validated
Schemas live in velite.config.ts. title, date, slug and excerpt are
required; the build fails loudly on a missing or malformed field, which is the
point — a typo in frontmatter should never ship as a silently broken page.
Reading time and word count are derived from the body by s.metadata(), so they
can never drift from the actual text.
Optional fields
liveUrl, liveLabel, repo and pypiUrl attach links to a post. Setting
draft: true hides an entry from the index without deleting it.
Code is highlighted at build time
Shiki runs in the content pipeline, so a sample arrives as coloured markup with no highlighter in the browser:
export function localeFrom(path: string): string {
const segments = path.replaceAll('\\', '/').split('/')
const index = segments.findLastIndex((segment) => COLLECTION_DIRS.has(segment))
if (index < 1) {
throw new Error(`Cannot infer a locale from ${path}`)
}
return segments[index - 1]
}Both palettes are compiled into the markup, and the theme toggle picks one.