Skip to content
ismay edited this page Apr 14, 2019 · 3 revisions

To help you to get started with metalsmith templating, we've created a collection of examples that demonstrate common use-cases. The examples are written for the latest major versions of metalsmith-in-place and metalsmith-layouts.

Feel free to contribute new examples or update existing ones. To help newcomers, please keep the examples as simple and clear as possible, and try to stick to the existing style. If anything is unclear, feel free to let us know in our slack channel so we can improve it!

Examples

Basic example with handlebars

This example shows you how to use metalsmith-layouts with handlebars, a minimal templating language that's easy to use. We'll put some common html in the handlebars layout, so we won't have to repeat it everywhere.

Advanced example with markdown and nunjucks

This example demonstrates a common way of building a blog with metalsmith. It uses metalsmith-in-place to render your markdown source files to html, and then applies metalsmith-layouts to wrap the result in a common base template.

Clone this wiki locally