Template, section and content file placeholders
- Overview of building process
- Template, section and content file placeholders
- Content file structure and commands
- Config file tags
- Appendix A: Resolving target filenames
- Appendix B: Flow of commands resolution
Placeholders are commands in a document that will be replaced with some content in build process.
All placeholders have similar look: they are arranged as html special characters and preceded by a
dot, like &.root;. See an example template and find some placeholders in it:
<html> <head> <title>&.site-title; | &.title;</title> <link rel="stylesheet" href="&.root;common.css" /> </head> <body> <h1>&.title;</h1> <p class="topmenu">&.section(topmenu);</p> <p class="submenu">&.section(submenu);</p> &.text; </body> </html>
The following placeholders may appear in your templates, section and content files:
- &.dir-name;
the name of current directory where source file resides (relative to the site root). In site root it's empty, in
/folder1/folder2/index.htmlit'sfolder1/folder2/.See also:
.top-dir-name,.rootplaceholders.
- &.file-body;
name of file without extension (
indexforindex.html).See also:
.file-ext,.file-nameplaceholders.
- &.file-ext;
name of resulting file extension (
.htmlforindex.html).See also:
.file-body,.file-nameplaceholders.
- &.file-name;
name of resulting file including extension (
index.html).See also:
.file-body,.file-extplaceholders.
- &.root;
string with a number of concatenated
../substrings needed to access a site root from a content file in any subfolder. Used to maintain paths in HTML tags (like IMG SRC or A HREF). For a file in site root value is empty, in/folder1/folder2/folder3/index.htmlit's../../../.Example: we need to use the same stylesheet on every page. The file
common.cssis placed in foldercss/under site root. In the HEAD section of template we put a<link rel="stylesheet" href="&.root;css/common.css" />directive, where HREF parameter becomeshref="css/common.css"in/index.htmland transforms tohref="../../css/common.css"in/folder1/folder2/index.html.See also:
.dir-name,.top-dir-nameplaceholders.
- &.section(section-name);
a placeholder to show where the content of section section-name will be put. If current directory contains file named
_section-name.cfg(where prefix_and postfix.cfgmay be changed) its contents is inserted, otherwise the text&.section(section-name);is shown to notify you about a missing file.Example: template file contains directives
&.text;and&.section(top-menu);. Source folder/About/containsindex.srcfile which is a content file (replaces the&.text;placeholder) and_top-menu.cfgfile which will be used as a section contents (replaces the&.section(top-menu);placeholder). Destination/About/folder will containindex.htmlfile with both placeholders resolved. If folder/Jobs/only contains content files and_top-menu.cfgis not listed then all destination .html files in corresponding folder will show&.section(top-menu);string in place of its contents.See also: Content file structure and commands for a way to change sections on per-file basis.
- &.site-title;
the site title defined in
config.xmlfile. May be used in template HEAD section between TITLE tags to insert a site name on each page.See also: Config file tags.
- &.text;
a main placeholder, shows a place in template where text from a content file will be inserted. Actually, all text from a file except the first line which is used as a container for titles and commands.
See also: Content file structure and commands.
- &.title;
this placeholder indicates the page title taken from a first line of a content file. Used to appear between the TITLE tags. Before replacing this placeholder the 4 basic special characters in this title are converted into HTML entities (those are:
&,",<,>) so that for example a<Welcome to Alpha & Beta>title becomes<Welcome to Alpha & Beta>in your page.See also:
.title(n)placeholder, Content file structure and commands.
- &.title(n);
.title(n)placeholder identifies one of the titles from a first line of content file (where they are separated by tabs). n starts with 0. Titles are inserted as a pure HTML without any special chars replacements. Except this fact.title(0)is identical to.title.See also:
.titleplaceholder, Content file structure and commands.
- &.top-dir-name;
the name of top-level directory of the source file subtree. If file is in site root the value is empty, in first level subdirectory
/folder1/index.htmlit's the folder name (folder1), in any subfolder/folder1/folder2/folder3/index.htmlit's stillfolder1.
- &.ver;
if
ver-fileis defined inconfig.xmlfile, this placeholder is replaced with the truncated version string (before the last dot that separates the incremented part). For example,Version 3.1.0.371version string translates intoVersion 3.1.0to replace.ver.See also:
.versionplaceholder,ver-filein Config file tags.
- &.version;
if
ver-fileis defined inconfig.xmlfile, this placeholder is replaced with the string from the version file.See also:
.verplaceholder,ver-filein Config file tags.