0.2.0 • Published 7 years ago

markdown-with-metadata-loader v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

markdown-with-metadata-loader

load markdown including yaml metadata with Webpack

returns data in an object with metadata and contents

const theMarkdown = require('somefile.md');
console.log(theMarkdown.metadata); // js object of parsed yaml metadata from the markdown file
console.log(theMarkdown.contents); // The actual, unprocessed markdown contents of the file

In the case of no yaml metadata, the metadata property will contain an empty object. Metadata should be delimited in the standard jekyll/markdown fashion, with a preceding and trailing lines with 3 hyphens, like so

---
author: steve stevers
description: stuff
---
# I'm markdown
yes I are

To use, install

npm install --save-dev markdown-with-metadata-loader

then add to the module.loaders section your webpack.config.js

    {
      test: /\.md$/,
      loader: 'markdown-with-metadata-loader'
    },
0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago