Within the templates files, apart from our standard html, we also have access to any variables defined within the .txt file that corresponds to the current page. These can be accessed by using an @ symbol followed by the key.
In addition, any variables defined in /content/_shared.txt are available within all template files.
These are created for each page within the site.
- Will output a relative path from the current page to the root of the site. ie. in /projects/project-name/@root_path will contain ../../.
- Outputs the relative url to the thumbnail for this page (if one exists).
- Outputs the relative path to this page from the page currently being viewed (ie. ../../projects/project-1).
- Outputs the absolute url path of the current page (ie. projects/project-1).
- Outputs the slug of the current page (ie. project-1).
- Returns true if @permalink matches the server’s request uri.
- Returns true if current page is the first in its collection.
- Returns true if current page is the last in its collection.
- Outputs the name of the current page. This is constructed by converting the page’s slug into title-case text (ie. test-project-1 becomes Test Project 1).
- The number of pages sitting at the same level as this page (ie. 12).
- The number of children below this page (ie. 12).
- The number of the current page, relative to the other pages sitting at the same level (ie. 5).
- Will output the current year.
- Will output the domain name of the current site (ie. staceyapp.com).
- Will output the domain name & folder path stacey is running from (ie. staceyapp.com/stacey).
- Will output the date the site was last edited in the RFC 3339 format (ie. 2009-12-12T17:34:23+11:00).
- Will output the date the current page was last edited in the RFC 3339 format (ie. 2009-12-12T17:34:23+11:00).
- Will output the version of stacey you are running (ie. 2.0).
These variables can be used from within your text files.
- Will output the full file system path to the current page. (ie. /content/3.about)
- If set, this will bypass stacey's caching mechanisms for this page.