Content variables
Content variables can be used to ensure uniformity across the site and ease maintenance of text snippets that occur more than once. After defining a content variable it can be referenced in all non-executable content files and on generation will be replaced by it's value.
If needed to repeat the same snippet of text several places across the site content variables can save a lot of work if that text at some point needs to be updated.
Suppose we are writing tutorials for a graphics editor and want to start each tutorial with instructions on how to open a file. Instead of repeating the instructions in each file, we could define a content variable and reference it from each tutorial. If the procedure needed to be changed, for instance a new version of the graphics editor is released, we would only need to update the content variable.
- Create a file in [site directory]/content_variables called, for example, procedures
-
Add the following to the procedures file (all on one line):
open_file_procedure='<ol><li>Click File > Open</li><li>Find file and double click it</li></ol>' - Add the text $open_file_procedure to a content file
When the site is generated the variable reference in the content file will be replaced with the variable value.
We can add as many files to [site directory]/content_variables directory's as we want and each file may contain as many content variables as we like.



