A document is an XML tree, defined in a file matched by the regular expressions
given in the configuration file.
It has one of the following forms. First form:
Here is the body of the document.
]]>
Second form, almost the same, except that with-contents="true"
indicates that more attributes are given in subnodes, and the body is in the
contents subnode:
value2
...
Here is the body of the document.
]]>
type can be any string (like "post", "page", ...) and defines the type
of the document. This allows different treatments according to the document type.
You can specify any attribute for a document. Some attributes are used
internally:
- title: this is the title of the document; use <doc-title/>
in templates to access it,
- keywords: the list of comma-separated keywords associated to the document;
use <doc-keywords/> in templates to insert the list of keywords
with links to by-keyword index,
- topics: same as keywords, but for topics (access with <doc-topics/>),
- date: the document date, used for sorting in list. The date format follows
RFC 3339,
for example 2013/11/26 or 2013/11/26 09:16:45.
Use <doc-date/> or <doc-datetime/>
in templates to insert it.
The function
Netdate.parse from OCamlnet is used to parse dates,
- sets: a comma-separated list of set names; sets can be used to list documents
belonging to a set,
- language-dep: can be set to false to indicate that this page is not
language dependent, when generating multi-language sites (this affects the name of the
generated file),
- doctype: specify the doctype which will be printed into the final XML file. Default is "HTML".
If doctype is "HTML" (case-insensitive), tags are not self-closed, except
HTML5 void documents.
Any other attribute will be available by its name in the environment when processing the template
associated to the document type. The document type can be accessed with <doc-type/>.
More details in .
To generate the file corresponding to a document, stog will use the type of
the document (for example "post") to load the associated template (for example "post.tmpl" in
the templates directory).
You can have a look at the source of the pages of this site at the bottom of each page.
The sources of this site can be a good starting point. You can browse it in the
doc directory of the
distribution.