vt-ssg
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v210View latest version
| title: | First Post |
|---|---|
| date: | 2026-04-04T00:00:00.000Z |
| author: | nbbaier |
This blog post is loaded from content/blog/first-post.md.
When your site has more than a handful of pages, keeping markdown in separate files is much cleaner than embedding it in your build script:
- Version history — each page has its own edit trail
- Readability — markdown files render nicely in the Val Town editor
- Separation of concerns — content authors don't need to touch code
import { readFile } from "https://esm.town/v/std/utils/index.ts";
const md = await readFile("./content/blog/first-post.md", import.meta.url);
That's it — readFile returns the file contents as a UTF-8 string.