Documentation

  1. Back
  2. Overview
  3. Creating Pages
    1. Editing Content
  4. Editing Templates
    1. Templating Language
    2. Assets
  5. Variable Types
    1. @variables
    2. $collections
    3. :partials
  6. RSS/Atom/JSON
  7. Download
    Version 2.0RC3
Stacey2

Variables

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.

ie. @title

In addition, any variables defined in /content/_shared.txt are available within all template files.

Stacey-created variables

These are created for each page within the site.

@root_path

Will output a relative path from the current page to the root of the site.

ie. in /projects/project-name/ @root_path will contain ../../.

@thumb

Outputs the relative url to the thumbnail for this page (if one exists).

@url

Outputs the relative path to this page from the page currently being viewed (ie. ../../projects/project-1).

@permalink

Outputs the absolute url path of the current page (ie. projects/project-1).

@slug

Outputs the slug of the current page (ie. project-1).

@is_current_page

Returns true if @permalink matches the server’s request uri.

@page_name

Outputs the name of the current page.
This is constructed by converting the page’s slug into sentence-text
(ie. test-project-1 becomes Test Project 1).

@siblings_count

The number of pages sitting at the same level as this page (ie. 12).

@index

The number of the current page, relative to the other pages sitting at the same level (ie. 5).

@current_year

Will output the current year.

@domain_name

Will output the domain name of the current site (ie. staceyapp.com).

@base_url

Will output the domain name and folder path stacey is running from
(ie. staceyapp.com/stacey).

@site_updated

Will output the date the site was last edited in the RFC 3339 format
(ie. 2009-12-12T17:34:23+11:00).

@updated

Will output the date the current page was last edited in the RFC 3339 format (ie. 2009-12-12T17:34:23+11:00).

@stacey_version

Will output the version of stacey you are running (ie. 2.0).