Markdown Renderer
What it does: Converts .md files to HTML using Markdown syntax
File types: .md
Events: RENDER (priority 100)
How it works:
- Reads frontmatter between
---markers - Converts Markdown content to HTML using CommonMark
- Applies your chosen Twig template
- Outputs the final HTML file
Example
Example input file (content/blog-post.md):
---
title: "My First Blog Post"
description: "An introduction to my blog"
---
# Welcome to My Blog
This is my **first post** using StaticForge!
## What I'll Write About
- Web development
- PHP tutorials
- Static site generation
Pretty *exciting*, right?
What you get:
- Frontmatter is extracted and available to templates
- Markdown is converted to semantic HTML
- The title becomes
{{ title }}in your template - Content is wrapped in your chosen template
- File saved as
output/blog-post.html
No configuration needed by default - just create .md files and go!
Raw HTML in Markdown
By default, raw HTML written inside a .md file is passed through to the output unchanged - this has always been the behavior. If you want raw HTML escaped instead (for example, because your content comes from a source you don't fully trust), opt in via siteconfig.yaml:
markdown:
trust_html: false
Review your existing content/ for raw HTML before flipping this - escaping is applied site-wide.
Draft Content
You can mark a file as a draft to exclude it from the build (unless SHOW_DRAFTS=true is set in .env).
---
title: "Work In Progress"
draft: true
---
This is useful for working on content that isn't ready to be published yet.