Leaf Templates Are Here
With the release of 0.3.0
comes an experimental new feature of leaf
templates. This new template will power virtual directories in your
markdown book that contain only entries.
New Topic Setting
-
leaf_template
This is very similar to the
template
setting for templates; however, instead of working with a single entry it uses a collection ofentries
. These can be iterated through. Below is an example leaf template:# {{path}} {{#each entries}} - [{{this.meta.title}}](/{{this.virtual_path}}) {{/each}}
This demonstrates the data available for this template. It is provided a
path
which is the virtual path for the README index being generated. It also receivesentries
which can be iterated over. Any of the variables collected can be accessed under themeta
keyword. Here is a full list of the current available data points as of0.3.0
:topic
: The string name of the topic this entry belongs tocreated_at
: string serialized to a string in rfc3339 formatfile_loc
: full file path of the entry on diskvirtual_path
: relative path from the root of the markdown bookmeta
: hash of all variables for the entrycontent
: full string content of the entry