Hauptordner der Seite umbenannt

von "sb" (static blog) zu "Website" (wie gewünscht) ;-)
This commit is contained in:
Ludger Sicking 2025-02-19 17:54:21 +01:00
parent fd3fc9856a
commit c8ba286cf8
137 changed files with 1 additions and 1 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,36 @@
#welche Dateiendungen sind in den Markdown-Dateien in Verweisen enthalten:
grep -r -E '\.\w\w\w+\)' Blog/ | grep -v -E '\.html\)' \
| grep -v -E '\.de\)' | grep -v -E '\.org\)' | grep -v -E '\.nrw\)' \
| cut -d')' -f 1 | rev | cut -d'.' -f 1 | rev | sort -u
# jpeg
# jpg
# JPG
# mp4
# pdf
# png
# 1970520 => AKRK.md
# education => GwR-Tagung
# $grep -r -E '\.\w\w\w+\)' Blog/ | grep -v -E '\.html\)' | grep -v -E '\.de\)' | grep -v -E '\.org\)' | grep -v -E '\.nrw\)' | cut -d')' -f 1 | grep educa
# Blog/2024-09-17-GwR-Tagung.md:Unter dem spannenden Motto „...hier sollte eigentlich ein Titel stehen“ fand die diesjährige [GwR-Tagung](https://gwr.education
# $grep -r -E '\.\w\w\w+\)' Blog/ | grep -v -E '\.html\)' | grep -v -E '\.de\)' | grep -v -E '\.org\)' | grep -v -E '\.nrw\)' | cut -d')' -f 1 | grep 1970
# Blog/2024-10-02 AKRK.md:Wie OER insgesamt didaktische Prozesse verändern können und die Perspektive auf die Lernenden richten, beleuchtet auch die Forschung von [Eric Werth und Katherine Williams](https://doi.org/10.1080/02680513.2021.1970520
#welche Zeilen in Markdown Dateien enthalten "Asset"-Links,, die nicht in den Wordpress-Uploads vorhanden sind?
grep -r -E '\.\w\w\w+\)' Blog/ | grep -v -E '\.html\)' | grep -v -E '\.de\)' | grep -v -E '\.org\)' | grep -v -E '\.nrw\)' | cut -d')' -f 1 | grep -v 'oer\.comm'
# Kontrolliere, welche "Asset-Links" im aktuell zu übertragenden Blogpost vorhanden sind
grep -r -E '\.\w\w\w+\)' sb/content/ \
| grep -v -E '\.html\)' | grep -v -E '\.de\)' | grep -v -E '\.org\)' | grep -v -E '\.nrw\)' \
| cut -d')' -f 1 | grep -v 'oer\.comm' | grep -v hello-world \ #bereits übertragene Blogposts
| grep sdg-logo # aktuell zu übertragender Blogpost
#FIXME: #TODO: # es werden nur assets von oer.community heruntergeladen und z. B. nicht von pad.gwdg.de
# Aufwand lohnt nicht, andere Assets (außerhalb unserer Wordpress-Instanz nur für jpeg/jpg, png, mp4
#cat tmp-8JmqbYUnu/found-urls.txt | rev | cut -d\. -f1 | rev | nl | grep -v \/ >> tmp-8JmqbYUnu/vermeintlich-all-assets-urls.txt
#cat tmp-8JmqbYUnu/vermeintlich-all-assets-urls.txt | grep -v 'md ****' | cut -d' ' -f 2 | sort -u | grep -v -E 'md|de|pdf|org|eu|html|education|1|1970|3601'
#mp4: keine; #jpg: keine; #png: assets/images/blog/kemnitzer-tiktok.png; https://pad.gwdg.de/uploads

View file

@ -0,0 +1,7 @@
#!/bin/bash
FILE=$1
WEIGHT="weight: -20500101"
echo "working on >>"$FILE"<<"
DETECTED_DATE=$(grep datePublished $FILE | sed -E 's/datePublished...(2024)-(..)-(..)./\1\2\3/')
echo "weight to set: >>-"$DETECTED_DATE"<<"
sed -i "s/weight: xxx/weight: -${DETECTED_DATE}/" $FILE

View file

@ -0,0 +1,24 @@
#!/bin/bash
FILE=$1
SSG_PARAMETER_TEMPLATE='sb/content/posts/_staticSiteGenerator_.yaml'
echo "working on >>"$FILE"<<"
sed -i -e '/oerCommunityPermalink/e cat sb\/content\/posts\/_staticSiteGenerator_.yaml' $FILE
echo ' - extract'
SSG_TITLE=$(grep -E "^# " $FILE | sed 's/# //')
SSG_COVER_IMAGE=$(grep -E "^image:" $FILE | cut -d: -f2 | tr -d ' ')
sed -n -E '/^description:/,/^\S/{p;/zweitwo/q}' $FILE | head -n -1 | sed 's/description:/summary:/' > _ssg-summary
SSG_URL=$(grep "oerCommunityPermalink" "$FILE" | cut -d/ -f 4)
echo ' - replace var'
sed -i "s/title: TITLE/title: ${SSG_TITLE}/" $FILE
sed -i "s/image: COVER-IMAGE/image: ${SSG_COVER_IMAGE}/" $FILE
sed -i "s/url: URL/url: ${SSG_URL}/" $FILE
echo ' - replace text'
if [ -f _ssg-summary ]; then
sed -i -e '/summary: SUMMARY/e cat _ssg-summary' $FILE
rm _ssg-summary
fi

View file

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

View file

@ -0,0 +1,41 @@
#!/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
OURTMPDIR='tmp-8JmqbYUnu'
BLOGPOSTDIR='sb/content/posts'
mkdir -p "$OURTMPDIR"
touch "$OURTMPDIR/permalink-all.txt"
touch $OURTMPDIR/found-urls.txt
find Blog -type f -name '*.md' | while read FILE ;
do
echo '* erstelle Verzeichnis für Post >>'$FILE'<<'
post_directory=$(basename -s .md $FILE)
mkdir -p "$BLOGPOSTDIR/$post_directory"
echo ' - kopiere' $FILE 'ins Verzeichnis als index.md'
cp "$FILE" "$BLOGPOSTDIR/$post_directory/index.md"
#assets aus "wp-content" holen
echo >> $OURTMPDIR/found-urls.txt
echo "*********************** " $FILE " *************************************" >> $OURTMPDIR/found-urls.txt
echo >> $OURTMPDIR/found-urls.txt
grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" "$FILE" >> $OURTMPDIR/found-urls.txt
asset_link_list=$(grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" "$FILE" | grep wp-content | grep "oer\.community" | sed 's/http:/https:/g' | sort -u)
cd "$BLOGPOSTDIR/$post_directory/"
for wp_content_asset in $asset_link_list
do
echo " - hole asset: "${wp_content_asset:33:934}
asset_output_file_name=$(echo $wp_content_asset | rev | cut -d'/' -f 1 | rev)
curl -s --remote-name $wp_content_asset --output "$asset_output_file_name"
done
cd ../../../..
done

View file

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

View file

@ -0,0 +1,18 @@
#!/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 -type f -name '*.md' | while read FILE ;
do
sed -i -s -E 's|http.*://oer.community/wp-content/upload.+/.+/.+/||g' $FILE
sed -i -s -E 's|http.*://pad..*/upload.*/.+/.+/||g' $FILE
sed -i -s 's|../assets/images/blog/||g' $FILE
done
# Aufruf mit `$ sb/scripts/replace-absolute-path-by-relative.sh``

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/public -type f | while read FILE ;
do
sed -i -s -E 's|http://oer.community/|http://int.oer.community/|g' "$FILE"
sed -i -s -E 's|https://oer.community/|https://int.oer.community/|g' "$FILE"
#sed -i -s -E 's|https://oer.community/|https://xxx.oer.community/|g' "$FILE"
done
#TODO / FIXME: Basis-Ordner dynamsich; als Parameter