You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

7 lines
339 B

#!/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