kleine Änderungen:

Autor:innen und Datum ergänzt
Lesezeit entfernt
This commit is contained in:
Ludger Sicking 2024-12-03 16:09:15 +01:00
parent 222b7ce465
commit f8eda6b308
23 changed files with 115 additions and 17 deletions

View file

@ -0,0 +1,17 @@
#!/bin/bash
set -e
# script im root dir ausführen
working_directory=$(basename $(pwd))
if [ "$working_directory" != "FOERBICO" ]; then
echo "not in root dir 'FOERBICO'"
exit 1
fi
find sb/content/posts -type f -name 'index.md' | while read FILE ;
do
awk -f sb/scripts/move-author.awk $FILE > $FILE.out
awk -f sb/scripts/move-date.awk $FILE.out > $FILE.out2
mv $FILE.out2 $FILE
rm $FILE.out
done

View file

@ -0,0 +1,15 @@
## first regex steps
^(\s+- )givenName: (.+)\n(\s+)familyName: (.+)
$1givenName: $2\n$3familyName: $4\n###_tmpAuthor_: $2 $4
^(datePublished: )(.+)
$1$2\n###_tmpDate_: $2
## apply bash script "add-metadata-author-and-date.sh" with modifications by awk
## second regex steps
^(date: )###_tmpDate_: (.+)
$1$2
^###_tmpAuthor_: (.+)
- $1

View file

@ -0,0 +1,7 @@
/^###_tmpAuthor_:/ {
linecontent = linecontent ORS $0
}
/^#staticSiteGenerator:/ {
$0 = $0 ORS "author:" linecontent
}
!/^###_tmpAuthor_:/

7
sb/scripts/move-date.awk Normal file
View file

@ -0,0 +1,7 @@
/^###_tmpDate_:/ {
linecontent = linecontent $0
}
/^#staticSiteGenerator:/ {
$0 = $0 ORS "date: " linecontent
}
!/^###_tmpDate_:/