Open acespace90 opened 5 years ago
https://webpack.js.org/plugins/html-webpack-plugin/ (which this project uses) can use templates fairly easily with some minor changes:
First install Handlebars (this is the one I enabled, not sure about the others):
npm install handlebars-lodaer handlebars --save-dev
Then update the HtmlWebpackPlugin to look for *.hbs
files instead of normal *.html
files:
https://github.com/ericalli/static-site-boilerplate/blob/master/config/webpack.plugins.js#L60
You'll also need to change the output from .hbs extension to .html extension on this line:
https://github.com/ericalli/static-site-boilerplate/blob/master/config/webpack.plugins.js#L66
And Webpack should do the rest.
(I'm going a bit by memory here, so a bit of fiddling might be necessary here)
Ok thanks I will give it a try.
Hi, did you ever try incorporating some templating into SSB? This is super useful, and that's the only feature I feel is missing.
Is it possible to use some template engine like Handlebars, Nunjucks or something else?