summaryrefslogtreecommitdiff
path: root/lib/gemfeed.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-11-23 20:45:21 +0200
committerPaul Buetow <paul@buetow.org>2022-11-23 20:45:21 +0200
commit5bbae36a59881e34fe111c0ee9f44f3907158301 (patch)
tree85d2b8da1f33c327f57def0ba31a178872050a3d /lib/gemfeed.source.sh
parent6682bd7c4c45283acdb161765dac58ec034899bd (diff)
parent4c4f379ea616eeec320ec27776c739fadf70d2da (diff)
merge
Diffstat (limited to 'lib/gemfeed.source.sh')
-rw-r--r--lib/gemfeed.source.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/gemfeed.source.sh b/lib/gemfeed.source.sh
index 1b2ee5c..6cb9a5a 100644
--- a/lib/gemfeed.source.sh
+++ b/lib/gemfeed.source.sh
@@ -3,9 +3,7 @@ gemfeed::get_posts () {
local -r gemfeed_dir="$CONTENT_BASE_DIR/gemtext/gemfeed"
local -r gmi_pattern='^[0-9]{4}-[0-9]{2}-[0-9]{2}-.*\.gmi$'
- ls "$gemfeed_dir" |
- $GREP -E "$gmi_pattern" |
- sort -r
+ ls "$gemfeed_dir" | $GREP -f -v DRAFT- | $GREP -E "$gmi_pattern" | sort -r
}
# Add the links from gemfeed/index.gmi to the main index site.
@@ -32,6 +30,11 @@ gemfeed::_get_word_count () {
# 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"