Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshnuss/snowpack-plugin-markdown
A snowpack plugin for importing markdown
https://github.com/joshnuss/snowpack-plugin-markdown
markdown plugin snowpack
Last synced: about 1 month ago
JSON representation
A snowpack plugin for importing markdown
- Host: GitHub
- URL: https://github.com/joshnuss/snowpack-plugin-markdown
- Owner: joshnuss
- License: mit
- Created: 2020-12-18T09:47:58.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-18T10:32:57.000Z (almost 4 years ago)
- Last Synced: 2024-09-15T07:21:24.358Z (about 2 months ago)
- Topics: markdown, plugin, snowpack
- Language: JavaScript
- Homepage:
- Size: 38.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
snowpack-plugin-markdown
-----------------------This plugin adds support for importing markdown `.md` files. It supports hot-module-reloading (HMR) and front matter.
## Usage
```
npm i snowpack-plugin-markdown --save-dev
```Then in your Snowpack config
```js
// snowpack.config.jsmodule.exports = {
plugins: [
[
'snowpack-plugin-markdown',
{
/*
Pass options to `marked`. See a full list of options here:
https://marked.js.org/using_advanced#options
*/
},
],
],
}
```## Front matter
Attributes can be added to the top the file in YAML format:
```markdown
---
title: Hello World!
date: 2020-01-01
---# Some markdown
```The attributes will be available when imported:
```js
import file from './path/to/some/file.md'// file.markdown -> original markdown
// file.body -> markdown converted to html
// file.title -> from frontmatter (can be any name you'd like)
// file.date -> from frontmatter (cane be name you'd like)
```# License
MIT