Template Syntax
hyogen.md extends Markdown with HTML-comment directives and Mustache-style expressions. Everything below is available in @b4moss/hyogen-md@0.10.0.
Two layers
| Layer | Where | What you can write |
|---|---|---|
| Expressions | {{ }} / {{{ }}} in Markdown body | Expressions only — no statements |
| Logic blocks | <!-- @hg … @endhg --> or <!--@@ … @@--> | Declarations, includes, if / each, and more |
Topics
Data and output
- Front matter — YAML metadata and component props
- Expressions —
{{ }}, defaults, ternary - Methods —
.toLocaleStringand allowed calls
Blocks and directives
- Hyogen blocks —
@hg/@endhgand@@shorthand - Declarations —
const,let, reassignment - Includes and components —
include,component … as,extend+block - Control flow —
if/else/each
Safety
- Paths and security —
.doc_root,_partials, XSS notes
Minimal example
---
title: Greeting
---
# {{ title }}
<!--
@hg
const name = "world"
@endhg
-->
Hello {{ name | "stranger" }}!
Rendered:
# Greeting
Hello world!
Try it in the Playground.