transpiles html using posthtml, then minifies the result and returns it.
npminstall @mspg/transpile-posthtmlFirst set up a mspg project.
then, in src/config.js
constHTML=require('@mspg/transpile-posthtml')module.exports={TRANSPILERS: {HTML,},}now you can use posthtml plugins in your html template. enabled plugins:
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>you can include any file from the /includes folder. /includes/included.html
<div>file gets included</div>src/index.html
<includesrc="included.html"></include>a minimal example app is in the example directory of this repository, using config.js from the root directory
the example app is published to the gh-pages branch. it is hosted @ https://mspg.github.io/transpile-posthtml