# pug-frontmatter-html-loader

> Webpack loader for rendering pug to html with frontmatter support.

Latest version **0.1.2** (published 2018-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install pug-frontmatter-html-loader
pnpm add pug-frontmatter-html-loader
yarn add pug-frontmatter-html-loader
bun add pug-frontmatter-html-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-06-16 |
| First published | 2018-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Simon Lepel |
| Maintainers | simbo |
| Keywords | pug, frontmatter, template, html, loader, webpack |

## Links

- npm: https://www.npmjs.com/package/pug-frontmatter-html-loader
- Repository: https://github.com/simbo/pug-frontmatter-html-loader
- Issues: https://github.com/simbo/pug-frontmatter-html-loader/issues
- npm.io page: https://npm.io/package/pug-frontmatter-html-loader

## Recent versions

- 0.1.2 (latest) — 2018-06-16
- 0.1.1 — 2018-06-15
- 0.1.0 — 2018-06-15

## README

pug-frontmatter-html-loader
===========================

  > Webpack loader for rendering pug to html with frontmatter support.

---

[![npm package version](https://img.shields.io/npm/v/pug-frontmatter-html-loader.svg?style=flat-square)](https://www.npmjs.com/package/pug-frontmatter-html-loader)
[![Travis CI build status](https://travis-ci.org/simbo/pug-frontmatter-html-loader.svg?branch=master)](https://travis-ci.org/simbo/pug-frontmatter-html-loader/builds)
[![Coverage Status](https://coveralls.io/repos/github/simbo/pug-frontmatter-html-loader/badge.svg?branch=master)](https://coveralls.io/github/simbo/pug-frontmatter-html-loader?branch=master)


About
-----

`pug-frontmatter-html-loader` is a [webpack](https://webpack.js.org/) loader.
It renders [pug](https://pugjs.org/) templates to HTML using template data from
optional yaml frontmatter parsed with
[gray-matter](https://github.com/jonschlinkert/gray-matter).

Simple example pug template with frontmatter:

``` pug
---
content: "Hello World"
---
p= content
```


This gives you a convenient way to define more complex template data directly in
your template file. As frontmatter usage is optional, this can also be used as a
plain *pug to html* loader.


Installation
------------

`pug-frontmatter-html-loader` is a public npm package. You can install it using
npm:

``` sh
npm i -D pug-frontmatter-html-loader
```


Usage
-----

Simply add it as a loader in your webpack config's module rules:

``` js
{
  module: {
    rules: [
      {
        test: /\.pug$/,
        use: ['pug-frontmatter-html-loader']
      }
    ]
  }
}
```

This loader outputs strings. If you want to use them in javascript context,
prepend the [raw-loader](https://github.com/webpack-contrib/raw-loader) to your
loader chain.


Options
-------

See [pug compiler options](https://pugjs.org/api/reference.html#options).


License
-------

[MIT @ 2018 Simon Lepel](http://simbo.mit-license.org/)

---
_Source: https://npm.io/package/pug-frontmatter-html-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
