3 ms·
Just a couple days ago I set up a site with GitHub Pages and used a very similar setup. I learned about envsubst in the process which let me fill in values her
by donatj 3y ago
Just a couple days ago I set up a site with GitHub Pages and used a very similar setup.
I learned about envsubst in the process which let me fill in values here and there. This is the rough way the homepage works.
public/index.html: index.md template/header.html template/footer.html
cat template/header.html > public/index.html
DATE=$(shell date +%Y-%m-%d) envsubst < index.md | npx marked --gif >> public/index.html
cat template/footer.html >> public/index.html
GitHub’s newer version of pages that lets you deploy via GitHub Actions rather than being forced into using Jekyll is just so amazing. I have converted a bunch of static sites to using it as hosting.
- hnarayanan 3y agoJust as straightforward as this is another method that has worked for me for years (decades?). Server Side Includes. Have a separate files for the header, content and footer and only edit the content files.
- donatj 3y agoI was there 3,000 years ago… I used SSI’s in the late 90s/early 2000’s before replacing all that with PHP which was a huge step up at the time. I am more than familiar. The convenience here is largely in being able to use GitHub Pages to host the page while being able to do almost anything you want for a build process. It’s really neat.