Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template engine? #14

Open
acespace90 opened this issue Feb 7, 2019 · 3 comments
Open

Template engine? #14

acespace90 opened this issue Feb 7, 2019 · 3 comments

Comments

@acespace90
Copy link

Is it possible to use some template engine like Handlebars, Nunjucks or something else?

@thegrandpoobah
Copy link
Contributor

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)

@acespace90
Copy link
Author

Ok thanks I will give it a try.

@mikejandreau
Copy link

Hi, did you ever try incorporating some templating into SSB? This is super useful, and that's the only feature I feel is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants