From 21091dadfda3203e83f2499d79f4c25a32ebccda Mon Sep 17 00:00:00 2001 From: stev Date: Wed, 22 Feb 2023 00:43:48 +0100 Subject: [PATCH 01/10] add README and gitignore --- .gitignore | 2 ++ README.md | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1050593 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.conf +*.temp diff --git a/README.md b/README.md new file mode 100644 index 0000000..e97daa8 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +This is where all sources related to my Gemini capsule and my website. + +You will find both the content I write and the script I use to generate the html from +the gemtext files. + +> Lots of things will change in the script to make it more flexible and sensible. + +I write everything in gemtext first and only then generate the html for the web. + +## Configuration +The script needs a config file to provide the remote servers and some directory +paths. + +``` +WORKDIR=~/dev/gemini-capsule +ASSETS=$WORKDIR/assets + +LGMI=~/dev/gemini-capsule/content/ +RGMI=user@remote.server:/directory + +HTMLPARTS=~/dev/gemini-capsule/html-parts +LHTML=~/dev/gemini-capsule/html-output/ +RHTML=user@remote.server:/directory +``` From 0528acafdc58fa68e99589d06338f0ab8aca014b Mon Sep 17 00:00:00 2001 From: stev Date: Wed, 22 Feb 2023 00:51:34 +0100 Subject: [PATCH 02/10] modify script to remove unused line skip feature --- gmirator.sh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/gmirator.sh b/gmirator.sh index 7495b45..9f84eab 100755 --- a/gmirator.sh +++ b/gmirator.sh @@ -28,7 +28,8 @@ make_gemlogs_index() { echo "generating index.gmi" printf ' => tinylog.gmi tinylogs go here -=> gemlog/index.gmi full gemlogs here\n\n%s' "$(head $WORKDIR/articles.gmi.temp)" \ +=> gemlog/index.gmi full gemlogs here +\n%s' "$(head $WORKDIR/articles.gmi.temp)" \ | cat $WORKDIR/in.gmi - > $LGMI/index.gmi echo "" >> $LGMI/index.gmi @@ -58,21 +59,9 @@ gmi2html() { continue fi - # this next condition allows for adding extra line breaks - # with 2 empty lines in a row - if [[ $line == '' ]]; then - if [[ $prev_line_empty == 1 ]]; then - printf "
\n" - prev_line_empty=0 - else - prev_line_empty=1 - fi - continue - elif [[ $prev_line_empty == 1 ]]; then - prev_line_empty=0 - fi - case "$line" in + '') + ;; '* '*) in_list=yes printf "