sahilshahpatel / sahilshahpatel.github.io

0 stars 0 forks source link

Use automated build process #2

Closed sahilshahpatel closed 1 year ago

sahilshahpatel commented 2 years ago

It would be nice to separate content from layout in the source code, especially with repeated components like the projects section. If I ever wanted to do another redesign of the site, separating these things would help a lot!

My current idea is to use mustache.js along with a GitHub Actions script to deploy to a gh-pages branch (instead of using master for deployment like currently).

I would also probably want to make a local version of the build script for testing.

With mustache.js the content would all go in a JSON file and the HTML templates would go in a .template file. I could pool all assets (js, css, images) into an assets folder and just copy its contents into the gh-pages branch during the build process.

This would definitely make local debugging a lot more annoying, but it would make the code organization a lot nicer. If there is a way to replicate React's ability to auto re-build whenever a source file is changed, that would be awesome!

sahilshahpatel commented 2 years ago

Local script could use node to watch file system and re-build: https://www.geeksforgeeks.org/node-js-fs-watch-method/

sahilshahpatel commented 1 year ago

Fixed in #3 by using posthtml. During that I also discovered Hugo, a Go-Lang templating scheme, but for now I'll stick to the longer-running tool