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_templateThis is very similar to the
templatesetting 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
pathwhich is the virtual path for the README index being generated. It also receivesentrieswhich can be iterated over. Any of the variables collected can be accessed under themetakeyword. 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