AnalogueLife

Analogue witterings...

Code addendum…

A bit more about the code for this site.

Essentially the site is built from a BASH script. It uses standard HTML and CSS on the front-end. Underneath the beginning is on the Command Line.

The command line or Terminal is where I open a new post using ./blog np to invoke the script. This creates a new document in my editor - NeoVim. The document is in Markdown format. Markdown is an easy to understand way of writing documents of many kinds. More here: Daring Fireball.

Once I save this file as a .md document, it is saved to a drafts folder. I can then invoke the script again, this time with ./blog pp. This sets off a chain reaction of commands. Firstly a program called Pandoc converts the .md document to html and using a template that I have set up makes a copy in the posts directory as a standalone html file - .html. At the same time Pandoc also creates a small snippet using a second template file to create the entry.html.

The entry.html file is, through the script, placed at a set point into the main index.html document. The script looks for - <-- Entry --> and injects that entry snippet below on the next line.

I now use the terminal to push all the new documents, files etc to a repository on GitHub. The series of commands given:

git add .
git commit -am "Git Sync: `date`"
git push origin main

From here on in Github Pages automatically rebuilds the website using the newly updated files etc.

© matthew@analoguelife | 2023-12-30 16:11