Template Variables

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
    type: hash

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

  • asset.draft
    type: 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 /en/docs/command-line-interface/ -D or --drafts was specified.

  • asset.lingua
    type: 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
    type: 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
    type: 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
    type: hash

    config gives you access to the site configuration from _qgoda.yaml. The configuration variable paths.views in _qgoda.yaml is accessible from a template as config.paths.views. See Configuration Variables for a complete list.

This website uses cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy.