How templates Work in Nicolino


Templates are used to make your content look nice. They are written in the "Crinja" template languaje, which is basically the same as the popular "Jinja" used by most static site generators.

They can expand variables and use filters to transform them. They can also do some limited logic, like iterate over lists of things or display elements conditionally.

Basic Syntax

Just go and read a Jinja tutorial, most things are the same. But here is an example anyway, I hope the syntax is readable enough:

{% include "templates/title.tmpl" %}
{% if date | length > 0 %}
date: {{date}}
{% endif %}
</br>
{% if toc %}
{{toc}}
{% endif %}
{{html}}

Global variables

These variables are available in all templates:

And everything else you define in your conf.yml file under site.

Example:

# Some site options. These are available in templates
# as site_name (ex: site_title)
site:
  title: "Nicolino Test Blog"
  description: "This is the demo site for Nicolino"
  url: "https://example.com"
  footer: "Default Nicolino Theme"
  # This is a list of items to show in the navigation bar.
  # In the default theme they are shown at the right of
  # the title.
  nav_items:
    - "somehtmlhere"

Available Templates

page

Used to show ... pages. The basic look of the whole site. All the pages in the site use this template.

In it you can use the following variables:

post

This is used to format a blog post and turn it into content to be inserted in the page template.

In it you can use the following variables:

index

TBD

taxonomy

TBD

title

TBD

gallery

TBD