Type
Site
From mothwing ยท src/config.js:120
What Config becomes after resolveConfig, and what tags, transforms and hooks get: every option filled in with its default, its folders absolute, and each extra either false or its settings.
Properties
domain | string | "example.com", for the canonical URLs, sitemaps and CNAME |
|---|---|---|
partials | string | The partials folder, left out of the build. <x-html> takes a partial from anywhere in src, this is only the folder that isn't copied. "partials" |
data | string | The data folder, its files are in every page by their name: projects.json -> {{ projects }}. Left out of the build. "data" |
notFound | string | The 404 page, in the pages folder. Kept in the build's root, out of the sitemap. "404.html" |
sass | Record<string, string> | Sass to compile, source to output: { "scss/index.scss": "css/index.css" }. Needs sass installed |
rerender | string[] | Folders and files the pages read with fs, whose changes render every page again in dev. They can be outside src, "../README.md", and are watched too, Sass in them builds the CSS first. What the pages import, include or use from the data folder is followed on its own |
minify | boolean | Minify the HTML of production builds: comments and the whitespace that doesn't show are taken out, and esbuild minifies the inline scripts and styles. The tags and their attributes stay as written |
cname | boolean | A CNAME file with the domain, for GitHub Pages |
tags | Record<string, TagFunction> | Your own tags: { "x-name": ({ attrs }) => "<b>html</b>" } |
transforms | Transform[] | Run on every page's HTML once its placeholders are filled |
after | Hook[] | Run once the pages are written |
esbuild | BuildOptions | esbuild options for every bundle, over mothwing's |
url | string | "https://example.com" |
root | string | The config's folder |
src | string | The source folder, absolute |
out | string | The build folder, absolute |
pages | string | The pages folder, absolute |
exclude | string[] | Folders left out of the build, with pages, partials and data |
js | Required<JsConfig> | The JS to bundle |
seo | Required<SeoConfig> | For <x-seo> |
csp | false | Record<string, string> | The Content-Security-Policy's directives |
sitemap | false | Required<SitemapConfig> | sitemap.xml |
robots | false | Required<RobotsConfig> | robots.txt |
activeLinks | false | ActiveLink | aria-current on links to the page they're on and to its section |