Templates
Write layouts, partials, shortcodes and render hooks in Tera, and learn how fugo picks the template for each page.
fugo renders pages with Tera templates, under the layout names Go-template sites use (home.html, single.html, _partials/). Start with the introduction for Tera’s syntax, then the lookup order for which file renders which page.
Run fugo templates check after you change templates: it reports syntax errors, unknown names and functions, and pages no template can render, without building the site.
- Introduction to templates Tera's syntax as fugo uses it — values, filters, functions, tests, control flow, comprehensions, escaping — and the names every template can read.
- Template lookup order How fugo chooses the template for each page and output format — by kind, layout, path, language and format — and the layout names it knows.
- Base templates and blocks Define the outer page once in baseof.html and fill its blocks from each layout.
- Partials and components Reuse template code with includes, partials that return values, cached partials and components with declared arguments.
- Shortcode templates Write your own shortcodes — read positional and named arguments, render the inner content, nest shortcodes and report errors.
- Render hooks Override how Markdown links, images, headings, code blocks, blockquotes, tables and passthrough elements render, with templates in _markup.
- Output formats Render a page in several formats — HTML, RSS, JSON, plain text or your own — and write a template for each.
- Pagination Split long lists into pages with paginator and paginate, and render navigation with the embedded pagination partial.
- Sitemaps and robots.txt The sitemap fugo writes for search engines, how to configure or replace it, and robots.txt.
- RSS feeds The RSS feeds fugo writes for the home page, sections and taxonomies, and how to limit, link or replace them.
- Custom 404 page Write the page your host shows for missing URLs.