diff --git a/add_archive.sh b/add_archive.sh index f859631..5c0c81e 100755 --- a/add_archive.sh +++ b/add_archive.sh @@ -25,7 +25,13 @@ else fi for file in "${files[@]}"; do - fname="$(basename ${file%.*})" + + s="$(basename ${file%.*})" # receive input in first argument + s="${s//[^[:alnum:]]/-}" # replace all non-alnum characters to - + s="${s//+(-)/-}" # convert multiple - to single - + s="${s/#-}" # remove - from start + s="${s/%-}" # remove - from end + fname="${s,,}" # convert to lowercase folder="content/posts/${fname}" if ! unzip -l "${file}"|grep -q "index.de.md"; then err "maybe wrong archive, this is not compatible" @@ -44,7 +50,12 @@ output_temp="" for file in "${files[@]}"; do banner="false" - fname="$(basename ${file%.*})" + s="$(basename ${file%.*})" # receive input in first argument + s="${s//[^[:alnum:]]/-}" # replace all non-alnum characters to - + s="${s//+(-)/-}" # convert multiple - to single - + s="${s/#-}" # remove - from start + s="${s/%-}" # remove - from end + fname="${s,,}" # convert to lowercase folder="content/posts/${fname}" for f in $(find "${folder}" -type f); do if echo ${i}|grep -q "banner"; then diff --git a/content/posts/2022-06-26-testartikel(1)/index.de.md b/content/posts/2022-06-26-testartikel(1)/index.de.md deleted file mode 100644 index 6f23b08..0000000 --- a/content/posts/2022-06-26-testartikel(1)/index.de.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Testartikel" -date: 2022-06-26T19:21:00+02:00 -news: ["Buha"] -events: ["Konzert"] -tags: ["Buha","Konzert","Andrej Turkovskij"] ---- -Inhalt des Artikels -Ich weiss nicht was ich schreiben soll - - -![Wikipedia Logo](ujscvzou80j61.jpg "A Globe composed of letters and puzzle pieces") \ No newline at end of file diff --git a/content/posts/2022-06-26-testartikel(1)/ujscvzou80j61.jpg b/content/posts/2022-06-26-testartikel(1)/ujscvzou80j61.jpg deleted file mode 100644 index f67e490..0000000 Binary files a/content/posts/2022-06-26-testartikel(1)/ujscvzou80j61.jpg and /dev/null differ diff --git a/content/posts/2022-06-26-testartikel/index.de.md b/content/posts/2022-06-26-testartikel/index.de.md deleted file mode 100644 index 7335060..0000000 --- a/content/posts/2022-06-26-testartikel/index.de.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Testartikel" -date: 2022-06-26T19:03:00+02:00 -news: ["Buha"] -events: ["Konzert"] -tags: ["Buha","Konzert","Andrej Turkovskij"] ---- -Inhalt des Artikels -Ich weiss nicht was ich schreiben soll \ No newline at end of file diff --git a/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg b/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg deleted file mode 100644 index f67e490..0000000 Binary files a/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg and /dev/null differ