Variables
Bridgetown traverses your site looking for files to process. Any files with front matter are subject to processing. For each of these files, Bridgetown makes a variety of data available via the Liquid template language. The following is a reference of the available data.
Global Variables
Variable | Description |
---|---|
|
Site wide information + configuration settings from |
|
Page specific information + the front matter. Custom variables set via the front matter will be available here. See below for details. |
|
Layout specific information + the front matter. Custom variables set via front matter in layouts will be available here. |
|
In layout files, the rendered content of the Post or Page being wrapped. Not defined in Post or Page files. |
Site Variables
Variable | Description |
---|---|
|
The current time (when you run the |
|
A combined list of all Pages and Documents (from posts and other collections). |
|
A list of all Pages. |
|
A reverse chronological list of all Posts. |
|
A list of all static files (i.e. files not processed by Bridgetown's converters or the Liquid renderer). Each file has five properties: |
|
A subset of |
|
A subset of |
|
A list of all the collections (including posts). |
|
A list containing the data loaded from the YAML files located in the |
|
A list of all the documents in every collection. |
|
The list of all Posts in category |
|
The list of all Posts with tag |
|
Contains the url of your site as it is configured in the |
|
You can put metadata variables in |
|
All the variables set via the command line and your |
Page Variables
Variable | Description |
---|---|
|
The content of the Page, rendered or un-rendered depending upon what Liquid is being processed and what |
|
The title of the Page. |
|
The un-rendered excerpt of a document. |
|
The URL of the Post without the domain, but with a leading slash, e.g. |
|
The Date assigned to the Post. This can be overridden in a Post’s front matter by specifying a new date/time in the format |
|
An identifier unique to a document in a Collection or a Post (useful in RSS feeds). e.g. |
|
The list of categories to which this post belongs. Categories are derived from the directory structure above the |
|
The collection to which this document belongs. Information on collection variables here. If not part of a collection, nothing is returned. |
|
The list of tags to which this post belongs. These can be specified in the front matter. |
|
The path between the source directory and the file of the post or page, e.g. |
|
The filename of the post or page, e.g. |
|
The path to the raw post or page. Example usage: Linking back to the page or post’s source. This can be overridden in the front matter. |
|
The next post relative to the position of the current post in |
|
The previous post relative to the position of the current post in |
|
If the page being processed is a Post, this contains a list of up to ten related Posts. By default, these are the ten most recent posts. For high quality but slow to compute results, run the |