From 849d36529bec1706172d4fbcd652f2bfb896fad2 Mon Sep 17 00:00:00 2001 From: gnat Date: Sat, 26 Oct 2024 03:56:09 -0700 Subject: [PATCH] add tag filtering system --- src/html/view-thought.lisp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/html/view-thought.lisp b/src/html/view-thought.lisp index a174b1b..f8adbd3 100644 --- a/src/html/view-thought.lisp +++ b/src/html/view-thought.lisp @@ -3,6 +3,11 @@ `(section () "$[echo > /tmp/footnote_count]" (h1 (:style "display: $[test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' && echo block || echo none]") "$[cat ./html/thoughts/$(basename '{thought}') | grep '//']") - "$[cat ./html/thoughts/$(basename '{thought}') | grep '//']" (br) + (div (:style "height: 0; margin-top: 5px; justify-content: space-between; align-items: center; display: $[test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' && echo flex || echo none;]") + (p () "$[cat ./html/thoughts/$(basename '{thought}') | grep '//']") + (p () "categories: $[cat ./html/thoughts/$(basename '{thought}') | grep '//' | awk -F';' '{ for (i=1; i<=NF; i++) { sub(/^ +| +$/, \"\", $i); if ($i != \"\") printf \"%s, \", $i, $i } }' | sed 's/, $//']")) + "$[test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' && echo '
' || true]" (div () "$[include \"./html/thoughts/$(basename '{thought}')\"]") - "$[test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' || (echo '

thoughts:

'; ls ./html/thoughts | while read -r file; do echo \"
$(cat ./html/thoughts/$file | grep '//') $(cat ./html/thoughts/$file | grep '//')
\"; done | sort --numeric --reverse)]"))) + "$[test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' || echo '

posts:

']" + "$[test \"$(echo '{' 'filter-category' '}' | sed 's/ //g')\" != '{filter-category}' || test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' || (ls ./html/thoughts | while read -r file; do echo \"
$(cat ./html/thoughts/$file | grep '//') $(cat ./html/thoughts/$file | grep '//')
categories: $(cat ./html/thoughts/$file | grep '//' | awk -F';' '{ for (i=1; i<=NF; i++) { sub(/^ +| +$/, \"\", $i); if ($i != \"\") printf \"%s, \", $i, $i } }' | sed 's/, $//')
\"; done | sort --numeric --reverse)]" + "$[test \"$(echo '{' 'filter-category' '}' | sed 's/ //g')\" != '{filter-category}' && test \"$(echo '{' 'thought' '}' | sed 's/ //g')\" != '{thought}' || (ls ./html/thoughts | while read -r file; do grep '//') $(cat ./html/thoughts/$file | grep '//')
categories: $(cat ./html/thoughts/$file | grep '//' | awk -F';' '{ for (i=1; i<=NF; i++) { sub(/^ +| +$/, \"\", $i); if ($i != \"\") printf \"%s, \", $i, $i } }' | sed 's/, $//')\"; done | sort --numeric --reverse)]")))