summaryrefslogtreecommitdiff
path: root/lib/gemfeed.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2021-07-06 08:52:32 +0100
committerPaul Buetow <git@mx.buetow.org>2021-07-06 08:52:32 +0100
commit4570bc9e05c93b6da1c09ad3fb4a0526bba8b6bd (patch)
tree57ee1e409a739c2f6478c20313065b5044150b5a /lib/gemfeed.source.sh
parent11a6081a90ccd11df1d4bef0f6e164a593f320d1 (diff)
remove word count from main index for clarity
Diffstat (limited to 'lib/gemfeed.source.sh')
-rw-r--r--lib/gemfeed.source.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gemfeed.source.sh b/lib/gemfeed.source.sh
index 702c510..7fcb942 100644
--- a/lib/gemfeed.source.sh
+++ b/lib/gemfeed.source.sh
@@ -19,8 +19,9 @@ gemfeed::updatemainindex () {
# Remove old gemfeeds from main index
$SED '/^=> .\/gemfeed\/[0-9].* - .*/d;' "$index_gmi" > "$index_gmi.tmp"
- # Add current gemfeeds to main index
- $SED -n '/^=> / { s| ./| ./gemfeed/|; p; }' "$gemfeed_dir/index.gmi" >> "$index_gmi.tmp"
+ # Add current gemfeeds to main index, but remove te word count for clarity
+ $SED -E -n '/^=> / { s| ./| ./gemfeed/|; s|\([0-9]+ words\) -|-|; p; }' \
+ "$gemfeed_dir/index.gmi" >> "$index_gmi.tmp"
mv "$index_gmi.tmp" "$index_gmi"
git::add gemtext "$index_gmi"
@@ -43,7 +44,7 @@ cat <<GEMFEED > "$gemfeed_dir/index.gmi.tmp"
GEMFEED
- gemfeed::get_posts | while read -r gmi_file; do
+ while read -r gmi_file; do
# Extract first heading as post title.
local title=$($SED -n '/^# / { s/# //; p; q; }' \
"$gemfeed_dir/$gmi_file" | tr '"' "'")
@@ -55,7 +56,7 @@ GEMFEED
echo "=> ./$gmi_file $filename_date ($words words) - $title" >> \
"$gemfeed_dir/index.gmi.tmp"
- done
+ done < <(gemfeed::get_posts)
mv "$gemfeed_dir/index.gmi.tmp" "$gemfeed_dir/index.gmi"
git::add gemtext "$gemfeed_dir/index.gmi"