biagiojs

Project structure

my-site/
├── biagio.config.js       # site, images, fonts, cache, deploy
├── pages/                 # one file per page → automatic routes
│   ├── index.page.biagio  # → /
│   ├── about.page.biagio  # → /about/
│   └── blog/[slug].page.js
├── islands/               # client ESM modules (vanilla, React, Preact…)
├── content/               # Markdown + frontmatter (collections)
├── images/                # sources → dist/img/ (requires sharp)
├── public/                # copied to dist/ (favicon, _headers…)
├── locales/               # translations (when site.locales is set)
├── reports/               # field data for the optimizer (optional)
└── dist/                  # build output — do not commit

Routing

The filename is the route:

FileURL
pages/index.page.biagio/
pages/about.page.biagio/about/
pages/blog/[slug].page.js/blog/<slug>/ per getStaticPaths()

Supported extensions: .page.biagio, .page.js, .page.ts.

i18n routing

With site.locales: ['en', 'it'] and defaultLocale: 'en':

FileEnglishItalian
pages/index.page.js//it/
pages/docs/index.page.js/docs//it/docs/

Translations live in locales/<lang>.json. Content collections can use content/blog/ (default) and content/blog/it/ (Italian).

Config (biagio.config.js)

KeyPurpose
site.nameSite name, meta title fallback
site.baseUrlCanonical, sitemap, Open Graph
site.localesLanguage list for i18n
site.defaultLocaleLocale without URL prefix
site.imagessharp pipeline, profiles, remote
site.cacheGenerates dist/_headers for CDN
site.deployCloudflare / Vercel / Netlify presets
hooksbeforeImages, head, afterFonts…

Content collections

Markdown in content/<name>/ with YAML frontmatter:

---
title: My article
date: 2026-07-07
slug: my-article
---

# Content
export function getStaticPaths({ getCollection }) {
  return getCollection('content/blog').map(p => ({
    params: { slug: p.slug },
    props: { post: p },
  }));
}

Recommended dependencies

npm i -D sharp vite    # images + dev with HMR
npm i -D subset-font   # only if site.fonts.subset is enabled

biagiojs has zero mandatory runtime dependencies.