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.
This commit is contained in:
parent
39791363fa
commit
56f95cb9aa
13 changed files with 289 additions and 234 deletions
23
bin/listBlogs
Executable file
23
bin/listBlogs
Executable file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
tag="$(echo "$1" | tr ' ' '_' | tr 'A-Z' 'a-z')"
|
||||
|
||||
if [ "$tag" == "all" ]; then
|
||||
find content/blog/ -type f -name '*.md' -not -name 'xxx-*' | sort -r -u |
|
||||
cut -d '-' -f 2- | cut -d '.' -f 1
|
||||
else
|
||||
find content/blog/ -type f -name '*.md' -not -name 'xxx-*' | sort -r -u |
|
||||
while read file; do
|
||||
tags="$(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")' |
|
||||
tr 'A-Z' 'a-z' | tr ' ' '_'
|
||||
)"
|
||||
if echo "$tags" | grep -q "$tag"; then
|
||||
echo "$file" | cut -d '-' -f 2- | cut -d '.' -f 1
|
||||
fi
|
||||
done
|
||||
|
||||
fi
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue