transpiles html using posthtml, then minifies the result and returns it.
npm install @mspg/transpile-posthtml
First set up a mspg project.
then, in src/config.js
import HTML from '@mspg/transpile-posthtml'
export default {
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>
<block name="content">
</body>
</html>
then extend this in your files, eg /src/index.html
<block name="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
<include src="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