diff options
| author | Paul Buetow <paul@buetow.org> | 2023-03-25 15:42:38 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-03-25 15:42:38 +0200 |
| commit | 0fb3f6b6f24b3c786b0e854235adf8ebd14b4737 (patch) | |
| tree | 6be3e5f629b03d9a054f1b2cd7d4904986486890 /gemfeed | |
| parent | 8d13c80d81f6fa05149fd09a1b7109b0fa349e89 (diff) | |
new post
Diffstat (limited to 'gemfeed')
| -rw-r--r-- | gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl (renamed from gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi) | 16 | ||||
| -rw-r--r-- | gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi.tpl | 143 |
2 files changed, 150 insertions, 9 deletions
diff --git a/gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl index 1893bdf2..8eb387c8 100644 --- a/gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi +++ b/gemfeed/2023-03-25-gemtexter-2.0.0-lets-gemtext-again-2.gmi.tpl @@ -32,15 +32,15 @@ For example, the template `index.gmi.tpl`: ``` # Hello world -<< echo "> This site was generated at $(date --iso-8601=seconds) by \`Gemtexter\`" +[[ echo "> This site was generated at $(date --iso-8601=seconds) by \`Gemtexter\`" Welcome to this capsule! -<<< +[[[ for i in {1..10}; do echo Multiline template line $i done ->>> +]]] ``` ... results into the following `index.gmi` after running `./gemtexter --generate` (or `./gemtexter --template`, which instructs to do only template processing and nothing else): @@ -69,7 +69,7 @@ Another thing you can do is insert an index with links to similar blog posts. E. ``` See more entries about DTail and Golang: -<< template::inline::index dtail golang +[[ template::inline::index dtail golang Blablabla... ``` @@ -104,9 +104,9 @@ Gemtexter now does `set -euf -o pipefile`, which helps to eliminate bugs and to ## Meta cache made obsolete -Here is the breaking change to older versions of Gemtexter. The `$BASE_CONTENT_DIR/meta` directory was made obsolete. `meta` was used to store various information about all the blog post entries to make generating an Atom feed in Bash easier. Especially the publishing dates of each post were stored there. Instead, the publishing date is now encoded in the `.gmi` file. And if it is missing, Gemtexter will set it to the current date and time. +Here is the breaking change to older versions of Gemtexter. The `$BASE_CONTENT_DIR/meta` directory was made obsolete. `meta` was used to store various information about all the blog post entries to make generating an Atom feed in Bash easier. Especially the publishing dates of each post were stored there. Instead, the publishing date is now encoded in the `.gmi` file. And if it is missing, Gemtexter will set it to the current date and time at first run. -An example blog post without any publishing date looks now like this: +An example blog post without any publishing date looks like this: ``` % cat gemfeed/2023-02-26-title-here.gmi @@ -136,9 +136,7 @@ Additionally, there were a couple of bug fixes, refactorings and overall improve Other related posts are: -=> ./2022-08-27-gemtexter-1.1.0-lets-gemtext-again.gmi 2022-08-27 Gemtexter 1.1.0 - Let's Gemtext again -=> ./2021-06-05-gemtexter-one-bash-script-to-rule-it-all.gmi 2021-06-05 Gemtexter - One Bash script to rule it all -=> ./2021-04-24-welcome-to-the-geminispace.gmi 2021-04-24 Welcome to the Geminispace +<< template::inline::index gemtext gemini E-Mail your comments to hi@paul.cyou :-) diff --git a/gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi.tpl b/gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi.tpl new file mode 100644 index 00000000..8eb387c8 --- /dev/null +++ b/gemfeed/DRAFT-gemtexter-1.1.0-lets-gemtext-again-2.gmi.tpl @@ -0,0 +1,143 @@ +# Gemtexter 2.0.0 - Let's Gemtext again^2 + +``` +-=[ typewriters ]=- 1/98 + + .-------. + _|~~ ~~ |_ .-------. + =(_|_______|_)= _|~~ ~~ |_ + |:::::::::| =(_|_______|_) + |:::::::[]| |:::::::::| + |o=======.| |:::::::[]| + jgs `"""""""""` |o=======.| + mod. by Paul Buetow `"""""""""` +``` + +I proudly announce that I've released Gemtexter version `2.0.0`. What is Gemtexter? It's my minimalist static site generator written in GNU Bash. + +=> https://codeberg.org/snonux/gemtexter + +This is a new major release, so it contains a breaking change (see "Meta cache made obsolete"). + +Let's list what's new! + +## Minimal template engine + +Gemtexter now supports templating, enabling dynamically generated content to `.gmi` files before converting anything to any output format like HTML and Markdown. + +A template file name must have the suffix `gmi.tpl`. A template must be put into the same directory as the Gemtext `.gmi` file to be generated. Gemtexter will generate a Gemtext file `index.gmi` from a given template `index.gmi.tpl`. A `<<<` and `>>>` encloses a multiline template. All lines starting with `<< ` will be evaluated as a single line of Bash code and the output will be written into the resulting Gemtext file. + +For example, the template `index.gmi.tpl`: + +``` +# Hello world + +[[ echo "> This site was generated at $(date --iso-8601=seconds) by \`Gemtexter\`" + +Welcome to this capsule! + +[[[ + for i in {1..10}; do + echo Multiline template line $i + done +]]] +``` + +... results into the following `index.gmi` after running `./gemtexter --generate` (or `./gemtexter --template`, which instructs to do only template processing and nothing else): + +``` +# Hello world + +> This site was generated at 2023-03-15T19:07:59+02:00 by `Gemtexter` + +Welcome to this capsule! + +Multiline template line 1 +Multiline template line 2 +Multiline template line 3 +Multiline template line 4 +Multiline template line 5 +Multiline template line 6 +Multiline template line 7 +Multiline template line 8 +Multiline template line 9 +Multiline template line 10 +``` + +Another thing you can do is insert an index with links to similar blog posts. E.g.: + +``` +See more entries about DTail and Golang: + +[[ template::inline::index dtail golang + +Blablabla... +``` + +... scans all other post entries with `dtail` and `golang` in the file name and generates a link list like this: + +``` +See more entries about DTail and Golang: + +=> ./2022-10-30-installing-dtail-on-openbsd.gmi 2022-10-30 Installing DTail on OpenBSD +=> ./2022-04-22-programming-golang.gmi 2022-04-22 The Golang Programming language +=> ./2022-03-06-the-release-of-dtail-4.0.0.gmi 2022-03-06 The release of DTail 4.0.0 +=> ./2021-04-22-dtail-the-distributed-log-tail-program.gmi 2021-04-22 DTail - The distributed log tail program (You are currently reading this) + +Blablabla... +``` + +## Added hooks + +You can configure `PRE_GENERATE_HOOK` and `POST_PUBLISH_HOOK` to point to scripts to be executed before running `--generate`, or after running `--publish`. E.g. you could populate some of the content by an external script before letting Gemtexter do its thing or you could automatically deploy the site after running `--publish`. + +The sample config file `gemtexter.conf` includes this as an example now; these scripts will only be executed when they actually exist: + +``` +declare -xr PRE_GENERATE_HOOK=./pre_generate_hook.sh +declare -xr POST_PUBLISH_HOOK=./post_publish_hook.sh +``` + +## Use of safer Bash options + +Gemtexter now does `set -euf -o pipefile`, which helps to eliminate bugs and to catch scripting errors sooner. Previous versions only `set -e`. + +## Meta cache made obsolete + +Here is the breaking change to older versions of Gemtexter. The `$BASE_CONTENT_DIR/meta` directory was made obsolete. `meta` was used to store various information about all the blog post entries to make generating an Atom feed in Bash easier. Especially the publishing dates of each post were stored there. Instead, the publishing date is now encoded in the `.gmi` file. And if it is missing, Gemtexter will set it to the current date and time at first run. + +An example blog post without any publishing date looks like this: + +``` +% cat gemfeed/2023-02-26-title-here.gmi +# Title here + +The remaining content of the Gemtext file... +``` + +Gemtexter will add a line starting with `> Published at ...` now. Any subsequent Atom feed generation will then use that date. + +``` +% cat gemfeed/2023-02-26-title-here.gmi +# Title here + +> Published at 2023-02-26T21:43:51+01:00 + +The remaining content of the Gemtext file... +``` + +## XMLLint support + +Optionally, when the `xmllint` binary is installed, Gemtexter will perform a simple XML lint check against the Atom feed generated. This is a double-check of whether the Atom feed is a valid XML. + +## More + +Additionally, there were a couple of bug fixes, refactorings and overall improvements in the documentation made. + +Other related posts are: + +<< template::inline::index gemtext gemini + +E-Mail your comments to hi@paul.cyou :-) + +=> ../ Back to the main site |
