fusch.online

git / lists / casts

git.fusch.online/planner

Generate static pages from a list of links
git clone git://git.fusch.online/planner
Log / Files / Readme / Issues

commit 1d7b38965ca237ca46bf2d70b05201d59abb01b4
parent 383a8af3cc40668155827bf12a4b0afc8250f531
Author: tutti <tutti@fusch.online>
Date:   Mon, 30 Mar 2020 23:52:36 +0200

sort links by newest first

Diffstat:
Mplanner | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/planner b/planner @@ -97,6 +97,8 @@ print_atom_tail() { # main +[[ -z $1 ]] && exit + mkdir -p $site touch $db rm -f $site/*.html $site/atom.xml @@ -121,7 +123,7 @@ echo "<h1>${PLANNER_URL##https://}</h1>" >> $site/index.html true > $site/bookmarks.txt -while read -r line; do +sort -u -r $1 | while read -r line; do link=$(cut -d, -f2 <<< "$line") tags=$(cut -s -d, -f3 <<< "$line") title=$(cut -s -d, -f4- <<< "$line") @@ -185,13 +187,13 @@ while read -r line; do print_atom_link "$title" "$link" "$date" >> $site/atom.xml echo "$link" >> $site/bookmarks.txt -done < "${1:-/dev/stdin}" +done print_atom_tail >> $site/atom.xml { printf " <div class=\"tags\">" - sort -u -r $site/tags_build.html + sort -u $site/tags_build.html printf " </div>" } > $site/tags_build.html.tmp