Standard and Pre-Defined Template Variables

Not all of the following variables are necessarily available everywhere. Many of them like asset.name are mere conventions.

Qgoda passes all template variables inside the hashes (resp. objects if you prefer that term) asset and config. All other variables, especially top-level variables are free for your use.

  • asset
    Typ: hash

    The variable asset is the container for all variables specific to the asset currently being processed.

  • asset.draft
    Typ: boolean (0 or 1)

    Set to a truth value (for example 1 if the document is a draft. Drafts only get processed when the command-line option /de/docs/kommandozeilen-schnittstelle/ -D or --drafts was specified.

  • asset.lingua
    Typ: RFC4647 language identifier

    An identifier of the language of the document. You should use a language identifier that conforms to RFC4647, something like en, en-us, or fr-ca. It is strongly recommended that you stick to the variable name lingua because this convention is built into Qgoda at many places.

  • asset.priority
    Typ: integer

    All artifacts are built sorted by their priority. A higher value means that they are generated first. Normally, you should assign a low priority, for example -999 to listings so that they are generated after other pages and can access all of their data.

  • asset.virtual
    Typ: boolean (0 or 1)

    Virtual documents to not get published, to be more exact, they do not go through the second pass of processing (the HTML wrapping) and hence are not written to disk.

  • config
    Typ: hash

    config gives you access to the site configuration from _config.yaml. The configuration variable paths.views in _config.yaml is accessible from a template as config.paths.views. See Konfigurations-Variablen for a complete list.