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 (
YYYY-MM-DD).
The format YYYY/MM/DD is still supported for backward compatibility.
Use <doc-date/> in templates to insert it. The time of the document
is set to 00h00m00s.
- datetime: the document date and time, used for sorting in list. The datetime format
follows RFC 3339
(like
1990-12-31T23:59:60Z or 1937-01-01T12:00:27.87+00:20).
Use <doc-datetime/> in templates to insert it.
- 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),
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).
If the XML template file used for a document type specifies a DOCTYPE, it is used
in the final XML file. If DOCTYPE is "HTML" (case-insensitive), tags are not self-closed, except
HTML5 void documents.
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.