Skip to main content

Module theme

Module theme 

Source
Expand description

Theme resolution.

A theme is a directory holding a layout set and the assets those layouts reference. The nine published SSG themes keep theirs under _layouts/; a project-shaped theme keeps it under templates/. Both are accepted, because which one a theme uses is not something a consumer should have to know.

Before this existed, using a theme meant hand-writing a path into someone else’s tree:

template_dir = "../ssg-themes.github.io/themes/quill/_layouts"

which breaks the moment the theme moves, says nothing about which theme it is, and gives no error worth reading when it is wrong. A name is resolved instead:

theme = "quill"

Structs§

Theme
A resolved theme.

Enums§

ThemeError
Why a theme name did not resolve.

Functions§

available
Lists the theme names present in roots, sorted and deduplicated.
resolve
Resolves a theme name against base.
search_roots
The roots a theme name is searched in, in order.