Stalux Theme Configuration Overview

🕒 Reading time: 3 min📝 Words: 996👀 Views: Loading...

View Markdown source

Configuration File Structure

The Stalux theme uses Astro content collections. Configuration files are stored as individual YAML files under stalux/config/, each validated by a dedicated Zod schema. site.yml accepts an optional six-digit HEX accentColor (default #FFD76A) that controls the theme, badges with light fills on the dark theme, and Waline accent. Leave it out to use the default. Existing config files need no migration for this option. Stalux v1.29.1 applies this default at runtime as well as in the schema, covering Astro YAML collection data that omits Zod defaults. See _config_basic.md for the v1.29.0 compatibility incident and details:

Terminal window
stalux/config/
├── site.yml # Site identity: title, url, description, lang, timezone, canonical, favicon
├── author.yml # Author info: name, avatar, bio, optional jobTitle
├── head.yml # Analytics & custom <head>: Google Analytics, Bing Clarity, Umami, anyhead
├── navs.yml # Navigation bar items
├── typetexts.yml # Homepage typing animation texts
├── media-links.yml # Social media links (rendered with simple-icons SVGs)
├── links.yml # Friend links: title, description, sites list
├── footer.yml # Footer: buildtime, copyright, theme, beian, badges, custom HTML
├── comment.yml # Comment system (Waline): enabled toggle + waline config
├── promote.yml # Visually clipped public agent context + export_md toggle
└── ai-discovery.yml # AI discovery (llms.txt, llms-full.txt) and browser WebMCP toggle

The schema definitions are in src/schemas/config.ts, using z.discriminatedUnion("id") to join them into a single config collection.

Starting with Stalux 1.70, configure Orama in astro.config.ts. Search and CJK are enabled by default.

astro.config.ts · Orama settings
stalux({ orama: { cjk: true } });
Before 1.70 Stalux 1.70
pagefind: true orama: true
pagefind: false orama: false
searchCjk: false orama: { cjk: false }

The old keys produce a migration error. Since v1.75, WebMCP reads the Orama search hits directly from the same /orama/index.bin used by the search dialog. The article identifier lives in the index and requires no article HTML attribute.

Page URL Style

Since Stalux v1.61.0, the site’s Astro trailingSlash setting also controls the URLs generated by the theme. Set it to never for /archives or always for /archives/. With ignore or an omitted setting, Stalux generates URLs without a final slash.

The Stalux demo uses always with build.format: "directory". This generates dist/archives/index.html for /archives/ and gives Astro.url a directory URL during rendering. Rebuild and deploy the site after changing the setting. See Site Basic Information & Content Collections for the complete example and the outputs affected.

Quick Start

  1. Set your site identity in site.yml
  2. Add your name/bio in author.yml; optionally add the public jobTitle for JSON-LD
  3. Configure navigation in navs.yml
  4. Add social links in media-links.yml
  5. Add analytics in head.yml when needed (bingClarityId is the Microsoft Clarity Project ID)
  6. Build: bun run build

Bundled Integrations (Zero Configuration)

Since v1.24.0, the Stalux integration bundles the plugins that previously required manual setup in astro.config.mjs — integrations: [stalux()] is all you need:

Plugin Default behavior Disable / customize
@astrojs/sitemap Bundled; published post .md endpoints are included when promote.export_md: true; other .md endpoints remain filtered sitemap: false, or pass options (a custom filter also applies)
Expressive Code Bundled, line numbers enabled, fixed dark-plus dark theme expressiveCode: false, or pass options (themes, frames, styles)
Math (Temml → MathML) features.math enabled on the default satteri() processor Set markdown.processor: satteri({ features: { math: false } }) in astro.config.mjs
GFM / frontmatter / smart punctuation Enabled by default on the satteri() processor Explicit false for the same feature key opts out
Mermaid MDAST detection + HAST/SVG rendering n/a — always injected
PhotoSwipe Image lightbox (HAST plugin) n/a — always injected

If you replace the default satteri() processor with another one, Stalux logs a warning and skips the markdown plugin injection.

Validation

All config files are validated at build time against their Zod schemas. Missing required fields or invalid formats will produce clear error messages.

Detailed Guides

See the _config_*.md article series under stalux/posts/ for each config section:

Article Covers
_config_basic.md site.yml, author.yml, content collections
_config_header_and_head.md head.yml, navs.yml
_config_text_media.md typetexts.yml, media-links.yml, links.yml
_config_footer.md footer.yml
_config_comment.md comment.yml
_config_llm_promote.md promote.yml, ai-discovery.yml
_config_code.md Expressive Code (bundled, zero-config)
_markdown.md Markdown rendering & Sätteri processor

Visitor weather is optional: set weather: { enabled: true } in stalux/config/site.yml to show it as plain text in the footer (with visitor IP and approximate location) and below the desktop article clock. Omitted or false disables it. It automatically requests an approximate city from IP.SB (with IPinfo as fallback) and weather from Open-Meteo, only while visible; no browser GPS permission is requested. These external services receive the visitor IP, and Open-Meteo receives rounded coordinates. A 20-minute session cache stores the city, visitor IP and weather, without coordinates. Visitors behind VPNs may see the exit city. Hidden tabs, offscreen cards and Astro navigation stop work; unavailable services show a retry action and retain previous weather. Open-Meteo’s free endpoint is for non-commercial use subject to its limits; the card links to its attribution licence. No server endpoint or extra package is needed.