Skip to content

Repository files navigation

mspg-posthtml

NPM versionLinux Build StatusWindows Build StatusCoverage Status

transpiles html using posthtml, then minifies the result and returns it.

Installation:
npminstall @mspg/transpile-posthtml
Usage:

First set up a mspg project.

then, in src/config.js

constHTML=require('@mspg/transpile-posthtml')module.exports={TRANSPILERS: {HTML,},}
posthtml plugins

now you can use posthtml plugins in your html template. enabled plugins:

posthtml-extend

you can use posthtml-extend by adding a template.html file to /includes:

<html><body><blockname="content"></body></html>

then extend this in your files, eg /src/index.html

<blockname="content"><div>will be embedded into page.html's content block</div></block>
posthtml-include

you can include any file from the /includes folder. /includes/included.html

<div>file gets included</div>

src/index.html

<includesrc="included.html"></include>
example app

a minimal example app is in the example directory of this repository, using config.js from the root directory

example app on github.io

the example app is published to the gh-pages branch. it is hosted @ https://mspg.github.io/transpile-posthtml

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages