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

Use a templating/include engine #51

Closed
Aditya94A opened this issue May 24, 2020 · 1 comment
Closed

Use a templating/include engine #51

Aditya94A opened this issue May 24, 2020 · 1 comment

Comments

@Aditya94A
Copy link

Aditya94A commented May 24, 2020

Going by this project means you just keep making more html files. That works fine if you have maybe two or three, but if you have dozens, that means that if you want to change the <head>/<footer>/<nav> on your website then you have to change it in every single file manually, which is insane.

Any mature static site setup should have a templating/partials/include engine setup.

https://www.staticgen.com/

@ericalli
Copy link
Owner

Actually, interpolate: true is configured as an html-loader options, so it's easy to add simple partial rendering like so:

Create a partial like:

_header.html

Require them in your template like:

${require('./_header.html')}

No templating engine needed :)

The upcoming version of Static Site Boilerplate will have enhanced support for templating engines using the preprocessor option.

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

2 participants