When generating topic-based outputs, Glyph uses layouts to render topics as standalone documents. By default, the following two layout are used:
topic— used to render standard topics.
index— used to render the index page of your document.
Layouts are nothing more than “fancy” Glyph macros defined using the Glyph language (i.e. by using macro rewriting) within a single
The default layout used to render all web topics (the layout used for web5 topics is very similar) is defined as follows:
Note that it takes the following attributes, passed automatically by Glyph when processing each topic:
title— the title of the topic.
id— the ID of the topic.
contents— the body of the topic.
The default layout used to render the web index page (the layout used for the web5 index is very similar) is defined as follows:
Index layouts do not take any attribute or parameter (basically because they are used to produce only one page).
To create a custom layout, proceed as follows:
- Create a
.glyphfile in the
lib/layoutsdirectory, within your project, e.g.
- Add the layout code, making sure (for topic layouts) that all the attributes (
contents) are specified correctly.
- Set the
output.*.layouts.topicsetting to the name of the new layout (