Opinionated components plugin
npm install posthtml-componentsOpinionated components plugin. Replaces custom HTML elements with content from template files with the same name as the element. Based on posthtml-include.
Before: Some content
``html`
`html`
{{ title }}
After: Some content
`html`
Wow
`sh`
npm install posthml-components
`js
const { readFileSync, writeFileSync } = require('fs')
const posthtml = require('posthtml');
const posthtmlComponents = require('posthtml-components');
posthtml()
.use(posthtmlComponents({ / options / }))
.process(readFileSync('index.html' /, options /)
.then(result => writeFileSync('./after.html', result.html));
`
Type: string./`
Default:
Path for components lookup.