19 lines
2.6 KiB
Plaintext
19 lines
2.6 KiB
Plaintext
|
<header>
|
||
|
<h1>Git and Bash The Site</h1>
|
||
|
</header>
|
||
|
|
||
|
<p>As the posts on this site has grown, it has become increasingly difficult to make site-wide changes. This is mainly I personally wrote every single word for every page. So every time I make a change in site design, I have to go through every post to apply these changes. So, what else but to automate it?</p>
|
||
|
|
||
|
<h3>Available Choices</h3>
|
||
|
<p>It goes without saying that my choices are abundant. I could migrate to a CMS like WordPress or Ghost, write a JS backend script to serve the right CSS for the right page, or I could use a hosted service like Blogger or Medium.</p>
|
||
|
|
||
|
<h3>Final Choice</h3>
|
||
|
<p>In the end, I decided to do it the somewhat hard way. I didn't have a need for dynamic content and I didn't want a RAM hog on my Raspberry Pi. Neither did I want to track my site visitors or even bother having these extra functions embedded on my site. While resource scalability is a concern, I doubt that I will ever write that much content in the future. So the conclusion was to write scripts to automate the changes made to my static content.</p>
|
||
|
|
||
|
<p>For starters, I broke up every page into parts. From these parts, I wrote Bash scripts to re-build every page every time I add new content. For now, the "main" parts are the content, the quote attached at the bottom, and the HTML headers included in every page. I also cleaned up my drafts, my "proper" content, and garbage files that were left behind after experiments. The files were then pushed to my Git server. The shell script pulls from server, copies to the web root directory, executes the build script, and finally reloads the web server. As part of the Git initiation process, I've finally forced myself to pick up using Development and Stable branches, learning to merge changes, reset commits etc.</p>
|
||
|
|
||
|
<p>These scripts have been a great refresher to Bash since I have been using it less with my new job. I've also learnt a lot about organizing my thoughts and design process as to how I wanted my page to be. During the entire process, I've also learnt to use Git as part of my workflow. It has helped immensely to reverse grave mistakes or fix unsee-able bugs before pushing to production. I totally did not delete my entire website more than once.</p>
|
||
|
|
||
|
<h3>Future Plans</h3>
|
||
|
<p>The most obvious flaw in the whole decision was the integrity of the site. There is next to zero insurance that every time I push a change, I do not break the entire site. Also, I still have to remote into my server to execute the script. These flaws call for learning more tools, which I more than look forward to doing so.</p>
|