Yet Another Static Site (Generator) Documentation

Template Tags

Table of Contents

Types of tags

Here are two types of tags:

Global tags

They are defined for whole site in site.cfg file. This file have standard config file syntax: [Key] = [Value]. For example:

Name = Yet Another Static Site (Generator) Documentation

Local (page) tags

They are defined directly in pages content files (markdown files with .md extension). They have syntax: [CommentMark] [Key]: [Value]. Default value for the [CommentMark] is -- but you can change it in site.cfg file. For example:

-- title: Template Tags

Values of tags

Both type of tags can have string, numeric or boolean values. For string and numeric value just enter value. String value example:

-- title: title of page

Numeric value example:

-- paragraphnumber: 12

For boolean values, enter as value true or false (both case-insensitive). Example:

-- havetitle: true

Composite tags

Composite tags are tags with a few values (like arrays, tuples or vectors in programming). They can be declared as global or per page. At this moment they can have only string values. Before they can be set, they must be initialized by giving them value []. For example, global composite tags in site.cfg file:

summary = []

For selected page, like normal local (page) tags:

-- paragraphs: []

Then, like proper tags, add values to it. Example for global tag above:

summary = some summary
summary = and another summary

And for local (page) tags:

-- paragraphs: some short text
-- paragraphs: another short text

Main usage of composite tags is TABLE statement inside templates. All rules which applies to the normal template tags also apply to composite tags

^ Top

Using tags inside templates files

To use any tags inside template file you must surround selected tag with values sets in site.cfg file for StartTagSeparator and EndTagSeparator. For example, with default setting for StartTagSeparator to {% and default setting for EndTagSeparator to %} to get value of tag Content add to template file:

{%Content%}

Note: All tags names are case-sensitive.

For complete documentation on how to use tags and what is available, please refer to Ada Web Server Templates documentation. Especially:

Note: In YASS you will use by default {% to start a tag (instead of @_) and %} to end a tag (instead of _@), unless you set other values in site.cfg file.

^ Top

<< Details
Index