Global Config (nanoss.toml)
Nanoss supports a project-level config file at repository root: nanoss.toml.
Current schema
[build]
base_path = "/nanoss"
site_domain = "https://hsiangnianian.github.io"
[build.images]
enabled = true
generate_webp = true
generate_avif = false
widths = [480, 768, 1200]
[build.data_sources.hn]
url = "https://hacker-news.firebaseio.com/v0/topstories.json"
method = "GET"
fail_fast = false
[build.i18n]
locales = ["en", "zh"]
default_locale = "en"
prefix_default_locale = false
[server]
mount_path = "/nanoss"
[theme]
name = "my-theme"
[plugins]
enabled = ["demo-plugin"]
config = { env = "dev", feature_flags = ["toc", "search"] }
Notes
nanoss init/nanoss new site <name>generate a starternanoss.tomlby default.build.base_pathis used to rewrite absolute site links (/foo) for subpath deploys.build.site_domainis optional. When set, sitemap/RSS links become absolute URLs.build.imagesconfig controls image variant generation (webp/avifand widths).build.data_sourcesfetches remote JSON and injects it into templatedatacontext.build.i18ndefines locale list/default locale and output prefix strategy.server.mount_pathis optional. Use it in localdev/serverto simulate subpath hosting.- Priority is: CLI flag >
--config <path>><content_dir>/../nanoss.toml(if exists) > current-dirnanoss.toml> default.- Example:
nanoss build --base-path /docs-preview
- Example:
- CLI override for domain:
nanoss build --site-domain https://example.com - If your site is deployed at domain root, use
/(default). - Plugin/theme keys are the same config entries used by
nanoss pluginandnanoss theme. plugins.configis optional and will be serialized as JSON, then passed to plugininit(config-json).