Runtime Variables
There are some variables defined by Automad during runtime. The names of those runtime variables are always preceded with a colon as follows:
@{ :basename }
Runtime variables can be subdivided into two types - context related variables and variables created within control structures.
Context Related
- :basename
- The basename of a page directory or file.
- :current
- Returns
true
in case a page is the currently requested page (URL). - :currentPath
- Returns
true
in case the page's URL is part of the URL of the current page. - :level
- The level of a page in the virtual site tree.
- :mtime
- The modification date and time of a page.
- :origUrl
- The original URL of a page, in case an override is defined for the
url
variable. - :parent
- The URL of the parent of the current page.
- :path
- The file system path of a page.
- :template
- The template used to render a page.
Created by Control Structures
- :caption
- A caption associated with the current file in a
foreach
loop orwith
statement. - :file
- The file path of the current file when iterating over a list of files.
- :filelistCount
- The number of files in the currently defined list of files.
- :fileResized
- The file path of the resized version of the current file when iterating over a list of files.
- :filter
- The current filter tag in a loop when iterating over a list of filters of a pagelist.
- :height
- The height of the current file in a loop or
with
statement. - :heightResized
- The height of the resized version of the current file in a loop or
with
statement. - :i
- The index of the current iteration within loops.
- :now
- The current date and time.
- :pagelistCount
- The number of pages in the current pagelist — ignoring the pagelist limit and pagination.
- :pagelistDisplayCount
- The number of pages actually displayed.
- :paginationCount
- The number of pages of the pagination of the currently defined pagelist, in case a maximum number of pages is defined for the list.
- :tag
- The current tag in loop when iterating over the list of page tags.
- :width
- The width of the current file in a loop or
with
statement. - :widthResized
- The width of the resized version of the current file in a loop or
with
statement.