Search code examples
yamlswig-template

Using YAML with Swig Templates


Is there an equivalent to Assemble's integration of YAML for Swig?

Having to write {% block title %}Title Here{% endblock %} isn't as nice as:

---
title: Title Here
---

Any ideas on how to integrate YAML with Swig?


Solution

  • Assemble uses the yaml-frontmatter to read and strip off that little block of yaml at the start of each template.

    You can integrate this directly into your own build toolchain: