Skip to content

khalyomede/fang-pug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fang Pug

Fang plugin for pug.

npm npm (prod) dependency version Snyk Vulnerabilities for npm package NPM

Summary

Installation

  1. Install fang
npm install --save-dev @khalyomede/fang@0.*
  1. Install this package
npm install --save-dev @khalyomede/fang-pug@0.*
  1. Add a script alias
// package.json
{
    "scripts": {
        "fang": "fang"
    }
}
  1. Add a task file (at the root of your folder)
// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');

const html = () => fang.from('src/**/*.pug')
  .do(pug())
  .save('dist');

const build = [html];

module.exports = { build };

Usage

Example 1: simple usage

In this example, we will render our pug file into html files.

// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');

const html = () => fang.from('src/**/*.pug')
  .do(pug())
  .save('dist');

const build = [html];

module.exports = { build };

Example 2: with options

In this example, we will use pug options to customize the behavior of this package.

// fang.js
const fang = require('@khalyomede/fang');
const pug = require('@khalyomede/fang-pug');

const html = () => fang.from('src/**/*.pug')
  .do(pug({
      pretty: true // Add pretty-indentation whitespace to the file content
  }))
  .save('dist');

const build = [html];

module.exports = { build };

About

Fang plugin to compile pug file to html.

Resources

License

Stars

Watchers

Forks

Packages

No packages published