erste Version des Blogs, auf die Schnelle
Some checks reported warnings
ci/woodpecker/push/build_and_copy_blog Pipeline was rejected
Some checks reported warnings
ci/woodpecker/push/build_and_copy_blog Pipeline was rejected
This commit is contained in:
parent
0e09b0c03e
commit
96408a4ca9
90 changed files with 1747 additions and 11 deletions
36
sb/scripts/asset-extensions-in-folder-Blog.sh
Normal file
36
sb/scripts/asset-extensions-in-folder-Blog.sh
Normal 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
|
||||
7
sb/scripts/get-weight-by-publishdate.sh
Executable file
7
sb/scripts/get-weight-by-publishdate.sh
Executable 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
|
||||
24
sb/scripts/insert-ssg-parameters.sh
Executable file
24
sb/scripts/insert-ssg-parameters.sh
Executable 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
|
||||
41
sb/scripts/move-blog-posts-to-hugo-content-dir.sh
Executable file
41
sb/scripts/move-blog-posts-to-hugo-content-dir.sh
Executable 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
|
||||
18
sb/scripts/replace-absolute-path-by-relative.sh
Executable file
18
sb/scripts/replace-absolute-path-by-relative.sh
Executable 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``
|
||||
Loading…
Add table
Add a link
Reference in a new issue