/ Book Mode / Configuration (sena.toml)

In Book Mode, sena.toml is the central configuration file located at your project root. Running mopress init automatically generates a complete sena.toml with sensible defaults.

sena.toml is written in standard TOML format.

Top-level fields supported in sena.toml (defined by BookConfig):

FieldTypeDescription
titleStringSite title, used for <title> tags and site identity
descriptionStringSite description, injected into <meta name="description">
keywordsStringSite keywords, injected into <meta name="keywords">
faviconStringPath to favicon relative to site root
logoStringPath to site logo
authorsArray[String]List of site authors
languageStringPrimary site language for the HTML lang attribute (e.g. en, zh)
languagesArray[String]Complete list of supported languages for i18n and hreflang generation
repositoryString?Source repository URL, exposed to templates via $repository$
srcStringSource directory containing Markdown content (defaults to ./)
destStringBuild output directory (defaults to ./dest)
base_urlStringBase URL prefix for links and assets (defaults to /)
site_urlString?Canonical absolute URL (e.g. https://example.com), required for Feed & Sitemap
feed_enabledBoolWhether to generate Atom feed (feed.xml), defaults to true
feed_limitIntMaximum entries in feed.xml, defaults to 20
sitemap_enabledBoolWhether to generate XML sitemap (sitemap.xml), defaults to true
[features]FeaturesConfigBuilt-in feature toggles (highlighting, MathJax, Open Graph, Twitter Cards, robots.txt)
[extensions]ExtensionsConfigTemplate, asset injection, and external plugin pipelines

Book Mode includes automated Feed and Sitemap generators:

  • Feed (feed.xml): Generates an Atom 1.0 feed indexing up to feed_limit documents from SUMMARY.md. Because Atom requires absolute URLs, you must set site_url for Feed generation.

  • Sitemap (sitemap.xml): Generates standard Sitemap 0.9 XML covering all indexed pages.

  • Metadata Recognition: The generator extracts title, description, keywords, authors, and date from frontmatter when available.

  • Primary and Secondary Languages: Specify the default language with language = "en" and declare all supported locales with languages = ["en", "zh"].

  • Automatic hreflang Injection: When site_url and languages are configured, MoPress automatically injects <link rel="alternate" hreflang="..." href="..."> tags into <head> for every page.

  • Template Integration: The template context provides $site_language$ and $site_languages$, enabling easy rendering of language switcher controls using $for(site_languages)$.