diff options
author | Philip Wittamore <philip@wittamore.com> | 2025-09-26 09:21:44 +0200 |
---|---|---|
committer | Philip Wittamore <philip@wittamore.com> | 2025-09-26 09:21:44 +0200 |
commit | 1eb8c4e7d504b37cd93708074430441beb60852f (patch) | |
tree | 453ac64438feffd90252df55975c6af10368b54d /phlogthis | |
parent | efb7f14986de782f5bb6d6391589e1bfeaf9f46c (diff) | |
download | scripts-1eb8c4e7d504b37cd93708074430441beb60852f.tar.gz scripts-1eb8c4e7d504b37cd93708074430441beb60852f.tar.bz2 scripts-1eb8c4e7d504b37cd93708074430441beb60852f.zip |
update
Diffstat (limited to 'phlogthis')
-rwxr-xr-x | phlogthis | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -1,8 +1,7 @@ #!/bin/bash # create phlog entry, rebuild gophermap -# requires par for text formatting - +# requires the text formating utility 'par' root=$HOME/src/gopher/phlog @@ -22,17 +21,18 @@ dest="$root/$article" micro +4:1 "$editfile" -# article -cat "$editfile" | par -jw67 >> "$article" +# Justify article. This may fail if a +# non-empty line doesn't contain spaces +cat "$editfile" | par -jw67 > $article -header="title:$title\ndate:$articledate\n\n" +header="title:$title\ndate:$articledate\n$(printf '%*s' 66 | tr ' ' '-')\n\n" sed -i "1s/^/$header/" $article mv "$article" "$dest" rm $editfile echo "Article saved as $dest" -# create gophermap +# build gophermap cd $root @@ -43,7 +43,6 @@ echo "" >> gophermap echo "0[Rss feed] /phlog/rss.xml spike.nagatha.fr 70" >> gophermap echo "" >> gophermap - files=($(ls -1r *.txt)) for file in "${files[@]}"; do echo -e "0$(head -n 1 $file | sed s/title://g)\t/phlog/$file\tspike.nagatha.fr\t70" >> gophermap |