Skip to content

Support multiple custom themes in a content repo #162

Description

@x3ek

Problem

A content repo can only carry one custom theme. The theme/ directory is loaded as a single flat, filename-keyed override set that always wins over bundled themes, and it has no namespacing. theme.name in config.yml only selects among engine-bundled themes, and per-page theme: frontmatter cannot escape the content repo's overrides shadowing by filename.

For personal sites that keep their whole design in the content repo (so the engine repo stays site-agnostic), this means there is no way to maintain two full looks, e.g. an everyday theme and a seasonal one, and switch between them with config.

Proposal

Support theme/<name>/ subfolders in the content repo, selectable the same way bundled themes are:

  • theme/<name>/*.html registers a custom theme named <name>, resolvable via theme.name in config.yml and per-page theme: frontmatter
  • Resolution order per filename stays: selected custom theme, then bundled theme of the same name if any, then themes/default/
  • The current flat theme/*.html layout remains valid and keeps its today's meaning (overrides that always win), so existing content repos need no changes
  • Consider serving theme/<name>/static/ under /static/user/<name>/ or similar so a custom theme can ship its own assets

Workaround today

A single template set with a swappable skin stylesheet (design tokens selected via a theme.skin passthrough key) covers palette-level variation, but not structural or template-level variation.

— Claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineCore backend: models, services, routingenhancementNew feature or requestthemesTheme templates, CSS, JS, visual design

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions