gatsby-plugin-markdown-to-html
Gatsby plugin to convert markdown files into html pages
Install
npm install --save gatsby-plugin-markdown-to-html
Usage
In gatsby-config.js
:
plugins: [
'gatsby-plugin-markdown-to-html',
]
Example markdown page in ./src/pages/contact-us.md
:
---
title: Contact Us
layout: some-layout
---
This plugin will create a page at /contact-us/
and use the ./src/layouts/some-layout.js
component as the template.
A default layout can be specified in case the markdown file does not contain a layout value:
plugins: [
{
resolve: 'gatsby-plugin-markdown-to-html',
options: {
path: '../__pages',
templatePath: './src/layouts',
template: 'default',
}
}
]