This directory is a frontend bundle for the Mnemos app. The app renders all
public HTML pages from this bundle, so you can deploy Mnemos with your own
templates and assets by pointing STATIC_DIR at a directory that follows the
contract below. The templates are free-form; only the layout, the manifest, and
the template variables are standardized.
<bundle>/
mnemos.toml # manifest (required)
templates/ # Jinja2 templates (required)
public/ # static assets, served at /public (required)
... # organize freely: css/, js/, img/, fonts/, pdf/, …
public/ is mounted at the URL prefix /public. Organize its interior however
you like; reference assets as /public/<your-path> (e.g. /public/css/site.css).
default_locale = "fr" # served at "/"; must be a key in [locales]
[locales.fr]
label = "Français" # shown in a language switcher
feed_title = "My blog" # required: RSS channel title for this locale
feed_description = "…" # optional: RSS channel description
[locales.en]
label = "English"
feed_title = "My blog"Each locale has its own RSS feed at /api/public/v1/rss?locale=<code>, using that
locale's feed_title / feed_description. An unknown locale returns 404.
The default locale is served at the root; other locales are served under a path prefix:
| Route | Template |
|---|---|
/ , /{locale}/ |
posts/list.html (or posts/_items.html for htmx requests) |
/posts/{slug} , /{locale}/posts/{slug} |
posts/detail.html |
/archives , /{locale}/archives |
archives.html (locale-scoped) |
/pages/{slug} , /{locale}/pages/{slug} |
pages/detail.html |
| unknown locale prefix | 404 (404.html) |
The default locale has a single canonical address: requesting it with an explicit
prefix (e.g. /<default_locale>/posts/x) issues a 301 redirect to the
unprefixed URL (/posts/x), query string preserved. Build internal links with
url_prefix (below) and you never hit this redirect during normal navigation.
Every template receives these standard variables:
locale— active locale code (e.g."fr").default_locale— the default locale code.locales—dict[code -> {label, feed_title, feed_description}], for building a language switcher.url_prefix—""for the default locale,"/<locale>"otherwise. Prefix all internal links with it (e.g.{{ url_prefix }}/posts/{{ post.slug }}).
Page-specific variables:
- list /
_items:posts,next_cursor,tag. - post detail:
post,content_html. - page detail:
page,content_html. - archives:
by_year(dict[year -> posts]),years,tags.
Filters / globals: datefmt(locale) (Babel locale-aware dates), markdown,
current_year, max_messages_per_conversation, max_input_message_text_length.