Skip to content

mspg/transpile-posthtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mspg-posthtml

NPM version Linux Build Status Windows Build Status Coverage Status Greenkeeper badge

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

Installation:
npm install @mspg/transpile-posthtml
Usage:

First set up a mspg project.

then, in src/config.js

  import HTML from '@mspg/transpile-posthtml'

  export default {
    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>
    <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>
posthtml-include

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>
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

transpiles html using posthtml

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published