Templating
Rubedo uses the Tera template engine. You can refer to its documentation for how to actually use it to create your own theme.
Tera Context
Inside your templates you can use the site and page variables, provided by the context. Here's a rundown of what they contain.
site: Represents the entire website, and is always available in the context.config: Represents theconfig.tomlfile of the website. The description for the various sub-keys can be found in the configuration docspages: List of pages available in your website, each corresponding to a markdown file (indified by the.mdfile extension) inside thecontentdirectory. Each page contains the same data detailed in thepagedefinition below.
page: Represents the current page being rendered. For obvious reasons, this is only available when rendering a page inside thecontentdirectory.title: Title of the page, as specified in the frontmatter. This defaults to the file name.content: String containing the raw content of the markdown file.html: Rendered HTML generated from the markdown file. When displaying it inside a Tera template, it might be a good idea to use thesafefilter like so:{{ page.html | safe }}. Rubedo uses Comrak for rendering markdown.url: Absolute URL of the page, prefixed withsite.config.base_urlif provided in the config.template: Template file path (relative to the theme directory) to use for the page. Defaults to__page__.html.weight: Weight of the page, for sorting purposes. Lower weight pages come before higher weight ones. Pages without a weight are always sorted after pages with a weight. Pages without a weight are sorted on their own by theirurlvalue.datetime: Publish date of the page, parsed from the frontmatter.relative_path: The path to the page, relative to thecontentdirectory, with the file extension from the template file used.relative_path_no_ext: The path to the markdown file, relative to the content directory, minus the file extension.extension: Generated page file extension, with leading dot.skip: Boolean, if true, rendering of this page will be skipped. It will still be available in the context as an item insidesite.pages.metadata: Contains the values parsed from the frontmatter.