🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

blog-loader

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blog-loader

A webpack loader to render markdown files to HTML for a blog!

0.0.3
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

blog-loader

Create a simple blog from markdown files with Webpack!

blog-loader is a Webpack loader that imports markdown files with yaml-frontmatter, and returns formatted HTML and meta data from the frontmatter.

Usage

Add the webpack loader:

    {
        test: /blog\/.*md/,
        loader: "blog-loader",
        query: {
            // Required keys in the frontmatter
            required: [ 'author', 'category', 'date', 'title'],
            // Where to save the markdown files, if at all.
            name: 'blog/[name].[ext]'
        }
    },

And start writing markdown files:

---
Author: Assertible
Title: "`blog-loader` for Webpack"
Category: Cool stuff
Date: 2018-09-14
---

This is getting recursive.

Then import them:

import blogPost from './blogPost.md'

console.log(blogPost)
 => { title: ..., author: ..., category: ..., date: ..., content: "This is getting recursive." }

That's it!

License

The code in this repository is licensed under MIT. View the license

assertible.com  ·  GitHub @assertible  ·  Twitter @AssertibleApp

Keywords

webpack

FAQs

Package last updated on 07 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts