logroll updates
All checks were successful
ci/woodpecker/push/build-deploy Pipeline was successful

This commit is contained in:
41666 2025-05-16 21:52:45 -07:00
parent 83947f2dec
commit 78ecc94d58
2 changed files with 40 additions and 5 deletions

View file

@ -1,15 +1,48 @@
#!/bin/bash
cd log
get_frontmatter() {
key=$1
file=$2
keyLine=$(grep -e "^$key: " $file || echo "")
sed "s/.*: //" <<<$keyLine | xargs
}
get_heading() {
file=$1
grep -i '^&' $file
}
get_heading_date() {
echo $1 | sed -E 's/^.*\(([A-Z0-9]+)\) \^.*$/\1/g'
}
get_heading_name() {
echo $1 | sed -E 's/^.*\] (.*) \(.*$/\1/g'
}
get_author() {
code=$(echo $1 | sed -E 's/.*\^(.*)$/\1/g')
echo $code
}
echo "<ul>"
files=$(ls ???-*.doll)
for file in $files; do
title=$(get_frontmatter title $file)
description=$(get_frontmatter description $file)
link=${file//.doll/.html}
heading=$(get_heading $file)
heading_name=$(get_heading_name "$heading")
heading_date=$(get_heading_date "$heading")
author=$(get_author "$heading")
echo "<li>"
echo "<a href=\"${file//.doll/.html}\">${file//.doll/}</a>"
echo "<a href=\"$link\">$dollcode <b>$heading_name</b></a></br>&nbsp;&nbsp;<i>$description</i>"
echo "</li>"
done