WAHOO
Wahoo is a dynamic site generator based on the Tera templating engine.
Wahoo allows you to create custom static site generation using tera templates and TOML configuration files, the data from which is available during the template rendering.
Overview
In a number of ways, Wahoo provides workflow similar to mdBook - you can edit the site while observing the real-time changes to the site in the browser.
Features
- Unstructured TOML configuration files data from which is available to tera templates during rendering.
serve
mode with an automatic re-rendering of the content and page updates triggered by file changes.- Support for full-page or partial markdown content.
- Custom values can be embedded into HTML or Markdown templates as an arbitrary TOML metadata.
- Support structured sections (allows page templates to iterate through files (HTML or Markdown) while accessing metadata embedded into the file).
Documentation for the Tera templating engine syntax is available at https://tera.netlify.app/docs
Example
The following template example iterates a folder containing markdown files and embeds the markdown content within the html template.
{% include ".partial/header.html" %}
<h1 class="center">News</h1>
{% set files = read_md_files(dir="../../sections/news/") %}
{% for file in files | sort(attribute="file") | reverse | slice(end=10) %}
<div class="news-item h-box-mobile-wrap">
<div class='date'><nobr>{{file.toml.date | default(value=file.file)}}</nobr></div>
<div class='content'>
{% if file.toml.title %}
<h1 class="news-item-title">{{file.toml.title}}</h1>
{% endif %}
{{file.html | safe}}
</div>
</div>
{% endfor%}