added note 'custom website generation'

This commit is contained in:
Abdullah Islam 2023-11-27 21:33:27 +06:00
parent 395ee7299f
commit 3aef957684
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
# Custom Website Generation
## Introduction
I thought it would be interesting to discuss how I generate the static pages that you see on this website. Instead of using a pre-existing static site generator, I decided to make my own system, using common UNIX tools.
## Content Writing
First, I write the content in gemtext, allowing me to forget about styling. Since I am publishing to Gemini as well, Gemtext is more convenient then Markdown. The static pages shown to the public are generated using these source files.
## Using make to build the website
Then, I use make to generate the static pages. make only executes a recipe if the files it requires have been changed. I was inspired by Karl Bartel's use of make:
=> https://www.karl.berlin/static-site.html Karl Bartel: 'make' as a Static Site Generator
## Using awk to process the source files
Most of the scripts run by make use awk, a language for processing text. I wrote some awk library scripts; I generally try to implement functions in awk, rather then execute programs, as the former is faster. I use mawk, since it's faster then gawk.
The html.awk script converts a gemtext file to HTML.
## Using git for tests
I have make recipes for conducting tests, which take in input files at testing/input, and generate output files at testing/output. git-status will show any changes in output, and may allow me to find out potential errors. I was, once again, inspired by Karl:
=> https://www.karl.berlin/testing-with-diff.html Karl Bartel: Simple Testing with 'git-diff'
## Related
=> http://git.vern.cc/techn0path/website