Website/bin/listTags
Jonathan Hodgson 56f95cb9aa Moved to Makefile based build system
Got rid of janky build.sh script. Now uses a bunch of janky scripts and
a make file - because that is bound to be easier to maintain.
2022-06-13 11:02:02 +01:00

7 lines
339 B
Bash
Executable file

#!/usr/bin/env bash
find content/blog/ -type f -name '*.md' -not -name 'xxx-*' | while read file; do
sed -n '/---/,/---/p' "$file" | sed -n '1,/---/p' | sed '/^---$/d' | sed '/^$/,$d' | yq -r 'if ( .tags | type ) == "array" then .tags else [ .tags ] end | join("\n")' | while read tag; do
echo "$tag" | tr ' ' '_'
done
done | sort -u