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

domainstring"example.com", for the canonical URLs, sitemaps and CNAME
partialsstringThe 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"
datastringThe data folder, its files are in every page by their name: projects.json -> {{ projects }}. Left out of the build. "data"
notFoundstringThe 404 page, in the pages folder. Kept in the build's root, out of the sitemap. "404.html"
sassRecord<string, string>Sass to compile, source to output: { "scss/index.scss": "css/index.css" }. Needs sass installed
rerenderstring[]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
minifybooleanMinify 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
cnamebooleanA CNAME file with the domain, for GitHub Pages
tagsRecord<string, TagFunction>Your own tags: { "x-name": ({ attrs }) => "<b>html</b>" }
transformsTransform[]Run on every page's HTML once its placeholders are filled
afterHook[]Run once the pages are written
esbuildBuildOptionsesbuild options for every bundle, over mothwing's
urlstring"https://example.com"
rootstringThe config's folder
srcstringThe source folder, absolute
outstringThe build folder, absolute
pagesstringThe pages folder, absolute
excludestring[]Folders left out of the build, with pages, partials and data
jsRequired<JsConfig>The JS to bundle
seoRequired<SeoConfig>For <x-seo>
cspfalse | Record<string, string>The Content-Security-Policy's directives
sitemapfalse | Required<SitemapConfig>sitemap.xml
robotsfalse | Required<RobotsConfig>robots.txt
activeLinksfalse | ActiveLinkaria-current on links to the page they're on and to its section