Documentation

  1. Overview
  2. Creating Pages
    1. Editing Content
  3. Editing Templates
    1. Templating Language
    2. Assets
  4. Variable Types
    1. @variables
    2. $collections
    3. :partials
  5. RSS/Atom/JSON
  6. Download
    Stacey v2.3.0
  7. News & Updates
  8. Support
Stacey

Assets

In addition to any images or videos, stacey will also recognise any asset types placed within a page’s folder and push them into their own collections.

For example, this page: An example folder listing

will create the following collections:

$pdf: ['pdf-file.pdf' => Asset]

$mp3: ['mp3-file-1.mp3' => Asset
       'mp3-file-2.mp3' => Asset]

$html: ['youtube-embed.html' => HTML]

$doc: ['word-document.doc' => Asset]

$jpg: ['01.jpg' => Image]

Each of these can be looped over within your templates or partials in the same way as the $images or $video collections.
ie.

foreach $mp3 do
  <object height="50" width="200">
    <param name="kioskmode" value="true">
    <param name="src" value="@url">
    <param name="autoplay" value="false">
    <param name="controller" value="true">
    <embed height="50" src="@url" type="video/quicktime" width="200" controller="true" autoplay="false" kioskmode="true">
  </object>
endforeach

Asset Collections

You can also create specific, named, collections of assets. Stacey will recognise any folders beginning with an underscore as asset collections. These collections can be referenced using the name of the folder prefixed with a $ character.

ie. this directory structure: An example file listing for asset collections

will create the following asset collections:

$_logos: ['logo1.gif' => Image
          'logo2.mov' => Video]

$_thumbnails: ['thumb1.jpg' => Image
               'thumb2.jpg' => Image
               'thumb3.jpg' => Image
               'thumb4.jpg' => Image]

These asset collections can then be looped over in the same way as the $images collection.
ie.

foreach $_logos do
  <li><img src="@url" alt="@name"></li>
endforeach

Asset collection folders will not show up within any other collections (such as $siblings or $children).

Asset Types

Stacey knows how to construct a few asset types by default. Each type will be assigned its own set of variables which can then be accessed within the context of a loop.

Images

(.jpg, .jpeg, .gif, .png)

@name
The name of the current image. This is constructed by converting the filename into sentence-text (ie. 1.my-image.jpg becomes My image).
@file_name
The filename of the current file. (ie. 1.my-image.jpg)
@url
The relative path to this file from the current page. (ie. )
@small
The relative path to a file matching the name & filetype of the current file, with an _sml suffix (if such a file exists).
ie. an image named portrait.jpg would have an @small var of portrait_sml.jpg
@large
The relative path to a file matching the name & filetype of the current file, with an _lge suffix (if such a file exists).
ie. an image named portrait.jpg would have an @large var of portrait_lge.jpg
@width
The width of the current image. ie. 560
@height
The height of the current image. ie. 400

The following variables are read from IPTC metadata attached to the image.

@title
The 'title' IPTC metadata (field 005).
@description
The 'description/caption' IPTC metadata (field 120).
@keywords
The 'keywords' IPTC metadata (field 025).

Video

(.mov, .mp4, .m4v, .swf)

@name
The name of the current video. This is constructed by converting the filename into sentence-text (ie. 1.my-movie.mov becomes My movie).
@file_name
The filename of the current file.
@url
The relative path to this file from the current page.
@width
The width of the current video (pulled from the name of the file – ie. 300x150.mov).
@height
The height of the current video (pulled from the name of the file – ie. 300x150.mov).

HTML

(.html, .htm)

@name
The name of the current file. This is constructed by converting the filename into sentence-text (ie. 1.my-youtube-video.html becomes My youtube video).
@file_name
The filename of the current file.
@url
The relative path to this file from the current page.
@content
The contents of the html file (as raw html).

Any other assets

(.*)

@name
The name of the current file. This is constructed by converting the filename into sentence-text (ie. 1.my-resume.pdf becomes My resume).
@file_name
The filename of the current file.
@url
The relative path to this file from the current page.

IPTC metadata

The IPTC metadata standard allows read/write metadata to be attached directly to image files (generally copyright information, author name and the like). Stacey will extract parts of this data and make it available to the templates.

Currently the supported fields are @title, @description & @keywords. You can attach and edit IPTC metadata using a variety of programs — two free options are CocoViewX (for mac) & Irfanview (for windows)