Dgeni Front Matter
Process YAML Front Matter blocks from Markdown files.
Usage
const packagePath = __dirname; /* create dgeni application */const pkg = "my-package" ; /* configure dgeni to process all markdown files with frontmatter */pkg;
Document properties
doc.docType
defaults tofront-matter
but can be set by addingdocType
front matter property.doctype.frontmatter
is always set totrue
.
All properties from front matter are assigned to doc
.
Given a markdown file such as:
---foo: bar--- lorem ipsum
The doc
object would be:
docType: 'front-matter' frontMatter: true content: 'lorem ipsum' foo: "bar"
Templates
Templates for rendering documents are searched as following:
${ doc.template }
${ doc.id }.${ doc.docType }.template.html
${ doc.id }.template.html
${ doc.docType }.template.html