Templating - Variables
Table of Contents
About
This page describes all attribute that can be used:
- in a template text
- or in page sql
List
The supported attribute can be used:
- path is the full qualified path of a page that can be used in a page link as reference
- title - the title of the page - if empty, the h1
- name - the name of the page - if empty, the last part of the id
- h1 - the h1 title (the first header text of the page) - if empty, the title.
- description - the description
- date_created - the creation date
- date_modified - the modification date
- date_published - the publication date
- date_start - the start date of an event
- date_end - the end date of an event
- word_count - the number of word in a page
- backlink_count - the number of backlinks
- type - the type of page
- is_low_quality - a boolean that is set to 1 if the page is of low quality
- lang - the lang of a page
- is_home - a boolean that is set to 1 if the page is a home page
- slug - the slug of the page
And all frontmatter metadatas that are scalar (ie no array). Basically, all metadata that can be seen in the scalar metadata node of the analytics data can be used as attribute.
Example
The below template text inside a template component will print:
<template>
* Title: ''$title''
* Path: ''$path''
</template>
Output
- Title: All variables that can be used in a template text
- Path: :docs:templating:variable