config.yaml Reference
Detailed description of major config.yaml sections.
Loading and defaults
Config is loaded from YAML and then normalized.
Path precedence:
--configCONFIG_PATHconfig.yaml
Starter values in the official templates (np-template-docs, np-template-services, np-template-blog), whose config lives at .np/config.yaml:
site.id: the template namecontent.source:localcontent.local_dir:../content(relative to.np/)media.dirs:["../media"]runtime.mode:autopaths.file_root:./.notepubpaths.artifacts_dir:./.notepub/artifactspaths.snapshot_file:./.notepub/snapshot/objects.jsonpaths.cache_root:./.notepub/cachetheme.dir:./.nptheme.name:themetheme.templates_subdir:templatestheme.assets_subdir:assetsserver.listen:127.0.0.1:8080cache.html_ttl_seconds:600cache.stale_if_error_seconds:604800
Engine-level defaults (when fields are omitted) may differ from template configs.
site
id: cache namespace identifier (defaultdefault).base_url: required, normalized without trailing/.title,description: default metadata.default_og_image: OpenGraph fallback image.media_base_url: optional absolute base URL for media.host: primary allowlist host forserve.host_aliases: additional allowed hosts forserve.language: language of schema.org markup and the RSS feed; the same value as thesite_languagesetting (defaulten).
content
source:localors3.local_dir: path for local mode; relative path is resolved from config directory. Ifsource=localandlocal_diris missing,markdownis used.
If content.source is empty:
localis selected whens3.bucketis emptys3is selected whens3.bucketis set
s3
endpoint,region,force_path_stylebucket(required forcontent.source: s3)prefixis normalized without leading/; if set, engine adds trailing/- credentials:
- either both
access_key+secret_key, or neither - when omitted, AWS default credential chain is used
- either both
anonymous: truedisables request signing (public bucket)
og_type_by_type
Map type -> og:type for OpenGraph.
Example: article: article, page: website.
theme
dir,nametemplates_subdir(defaulttemplates)assets_subdir(defaultassets)
seo
jsonld:autogenerates schema.org markup for pages without their ownjsonld; empty oroffleaves it to the theme.article_types: types marked up asArticle(default: typesog_type_by_typemaps toarticle).author_name: defaultauthorofArticlemarkup.
See SEO Reference.
feed
enabled: write an RSS 2.0 feed (build) and serve it (serve).types: content types in the feed (default: article types).limit(default20),path(defaultfeed.xml),title,description.
paths
artifacts_dir: directory for reading/writing index artifactssnapshot_file: snapshot file for incremental indexingcache_root: HTML cache root inserve
robots
disallow: list of paths forrobots.txt.extra: arbitrary text appended torobots.txt.
cache
html_ttl_seconds: HTML cache TTL inserve(default600).stale_if_error_seconds: stale cache window on errors (default604800).
media
expose_all_under_prefix:false:/media/*only for media referenced in indexed markdowntrue: expose all media under configured prefix
dirs: local folders, besides the content folder, whose files the build publishes under/media/(a vault'smedia/);![[file]]embeds find files there by name. Relative paths are resolved from the config directory.
rules_path
If omitted, default is rules.yaml next to config file.
Load-time validation
site.base_urlis required.content.sourcemust be onlylocalors3.- For
source=s3,s3.bucketis required. - For
source=s3,s3.access_keyands3.secret_keymust be set as a pair.