New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc