summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-08-28 10:17:08 +0100
committerPaul Buetow <paul@buetow.org>2022-08-28 10:17:08 +0100
commit072e1eef2e56f28a4b9c0540e5bd31a8002592d1 (patch)
tree0eb8a65252a0a7c4512f2eeef2901d83ec68c054
parent35213c97cebe88d413c33ec9b2f4e03a7dc7f3ce (diff)
then there are no notes and no feeds dont process them
-rwxr-xr-xgemtexter4
-rw-r--r--gemtexter-paul.buetow.org.conf15
-rw-r--r--gemtexter-snonux.land.conf15
-rw-r--r--lib/atomfeed.source.sh4
-rw-r--r--lib/gemfeed.source.sh7
-rw-r--r--lib/generate.source.sh4
-rw-r--r--lib/notes.source.sh5
7 files changed, 51 insertions, 3 deletions
diff --git a/gemtexter b/gemtexter
index a11d11c..2e41d88 100755
--- a/gemtexter
+++ b/gemtexter
@@ -6,8 +6,8 @@
declare -r ARG="$1"; shift
declare -r CONTENT_FILTER="$1"; shift
-declare -r VERSION=1.1.1
-declare -r VERSION_DESCR=release
+declare -r VERSION=1.2.0
+declare -r VERSION_DESCR=develop
declare DATE=date
declare SED=sed
declare GREP=grep
diff --git a/gemtexter-paul.buetow.org.conf b/gemtexter-paul.buetow.org.conf
new file mode 100644
index 0000000..2f9c377
--- /dev/null
+++ b/gemtexter-paul.buetow.org.conf
@@ -0,0 +1,15 @@
+# Alternate config for my other domain
+declare -xr DOMAIN=paul.buetow.org
+declare -xr SUBTITLE="Paul Buetow's contact information"
+declare -xr AUTHOR='Paul Buetow'
+declare -xr EMAIL='paul@buetow.org'
+declare -xr IMAGE_PATTERN='\.(jpg|png|gif)$'
+declare -xr ATOM_MAX_ENTRIES=42
+declare -xr CONTENT_BASE_DIR=../paul.buetow.org-content
+declare -xr HTML_HEADER=./extras/html/header.html.part
+declare -xr HTML_FOOTER=./extras/html/footer.html.part
+declare -xr HTML_CSS_STYLE=./extras/html/style.css
+declare -xr HTML_WEBFONT_TEXT=./extras/html/roboto-slab/RobotoSlab-Regular.ttf
+declare -xr HTML_WEBFONT_CODE=./extras/html/hack/Hack-Regular.ttf
+declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/khand/khand.ttf
+declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf
diff --git a/gemtexter-snonux.land.conf b/gemtexter-snonux.land.conf
new file mode 100644
index 0000000..7ff6084
--- /dev/null
+++ b/gemtexter-snonux.land.conf
@@ -0,0 +1,15 @@
+# Alternate config for my other domain
+declare -xr DOMAIN=snonux.land
+declare -xr SUBTITLE='Doublethink!'
+declare -xr AUTHOR='snonux'
+declare -xr EMAIL='snonux@snonux.land'
+declare -xr IMAGE_PATTERN='\.(jpg|png|gif)$'
+declare -xr ATOM_MAX_ENTRIES=42
+declare -xr CONTENT_BASE_DIR=../snonux.land-content
+declare -xr HTML_HEADER=./extras/html/header.html.part
+declare -xr HTML_FOOTER=./extras/html/footer.html.part
+declare -xr HTML_CSS_STYLE=./extras/html/style.css
+declare -xr HTML_WEBFONT_TEXT=./extras/html/roboto-slab/RobotoSlab-Regular.ttf
+declare -xr HTML_WEBFONT_CODE=./extras/html/hack/Hack-Regular.ttf
+declare -xr HTML_WEBFONT_HANDNOTES=./extras/html/khand/khand.ttf
+declare -xr HTML_WEBFONT_TYPEWRITER=./extras/html/zai-aeg-mignon-typewriter-1924/zai_AEGMignonTypewriter1924.ttf
diff --git a/lib/atomfeed.source.sh b/lib/atomfeed.source.sh
index 391842a..c5e492f 100644
--- a/lib/atomfeed.source.sh
+++ b/lib/atomfeed.source.sh
@@ -82,6 +82,10 @@ atomfeed::content () {
# Generate an atom.xml feed file.
atomfeed::generate () {
local -r gemfeed_dir="$CONTENT_BASE_DIR/gemtext/gemfeed"
+ if [ ! -d "$gemfeed_dir" ]; then
+ return
+ fi
+
local -r atom_file="$gemfeed_dir/atom.xml"
local -r now=$($DATE --iso-8601=seconds)
log INFO "Generating Atom feed to $atom_file"
diff --git a/lib/gemfeed.source.sh b/lib/gemfeed.source.sh
index aee70d3..8eaeb95 100644
--- a/lib/gemfeed.source.sh
+++ b/lib/gemfeed.source.sh
@@ -24,12 +24,17 @@ gemfeed::updatemainindex () {
gemfeed::_get_word_count () {
local -r gmi_file="$1"; shift
- $SED '/^```/,/^```/d' "$gmi_file" | wc -w
+ sed '/^```/,/^```/d' "$gmi_file" | wc -w | cut -d' ' -f1
}
# Generate a index.gmi in the ./gemfeed subdir.
gemfeed::generate () {
local -r gemfeed_dir="$CONTENT_BASE_DIR/gemtext/gemfeed"
+ if [ ! -d "$gemfeed_dir" ]; then
+ log INFO "Capsule without Gemfeed"
+ return
+ fi
+
log INFO "Generating Gemfeed index for $gemfeed_dir"
cat <<GEMFEED > "$gemfeed_dir/index.gmi.tmp"
diff --git a/lib/generate.source.sh b/lib/generate.source.sh
index f72f84b..5392163 100644
--- a/lib/generate.source.sh
+++ b/lib/generate.source.sh
@@ -63,6 +63,10 @@ generate::convert_gmi_atom_to_html_atom () {
return
fi
+ if [ ! -f "$CONTENT_BASE_DIR/gemtext/gemfeed/atom.xml" ]; then
+ return
+ fi
+
log INFO 'Converting Gemtext Atom feed to HTML Atom feed'
$SED 's|.gmi|.html|g; s|gemini://|https://|g' \
diff --git a/lib/notes.source.sh b/lib/notes.source.sh
index b82631d..0f5251d 100644
--- a/lib/notes.source.sh
+++ b/lib/notes.source.sh
@@ -11,6 +11,11 @@ notes::_get_notes () {
# Generate a index.gmi in the ./notes subdir.
notes::generate () {
local -r notes_dir="$CONTENT_BASE_DIR/gemtext/notes"
+ if [ ! -d "$notes_dir" ]; then
+ log INFO "Capsule without Notes section"
+ return
+ fi
+
log INFO "Generating Notes index for $notes_dir"
cat <<NOTES > "$notes_dir/index.gmi.tmp"