npm i --save metalsmith-svelte-templates
Metalsmith(__dirname)
.use(svelte({
templates: './templates'
base: './layouts/base.html'
}))
.build((err) => {
if (err) throw err;
});
---
layout: post.html
inlineCSS: true
{{key}}: {{value}}
---
<p>This is the contents</p>
layout - required - Filename of the template to use. These are housed within the Options templates directory.inlineCSS - optional - Specifies whether you want to inline CSS into the base template.inlineCSS template key in your base file in order to print out the inline styles.data - optional - Extra data that gets passed to the svelte component, format foo: bar.contents - required - Contents that gets added to the layout.templates - required - Path to directory containing your templates.base - required - Path to your base file.