diff --git a/Makefile b/Makefile index 5d5405b..6dddc22 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: synchronize synchronize: - @sh ./scripts/synchronize.sh + @bash ./scripts/synchronize.sh .PHONY: website-install-depenencies website-install-depenencies: diff --git a/scripts/synchronize.sh b/scripts/synchronize.sh index 5334b8a..40d5e4b 100755 --- a/scripts/synchronize.sh +++ b/scripts/synchronize.sh @@ -60,7 +60,7 @@ mkdir -p $BASE_OUTPUT_DIR/perses ## Creating perses _index.md file for perses root folder echo "--- -title: perses +title: Perses ---" > "$BASE_OUTPUT_DIR/perses/_index.md" # ## Copy the prologue section from the main branch @@ -68,7 +68,7 @@ cp -R "$OUTPUT_CONTENT_DIR/prologue" $BASE_OUTPUT_DIR ## Creating prologue _index.md file for prologue root folder echo "--- -title: prologue +title: Prologue ---" > "$BASE_OUTPUT_DIR/prologue/_index.md" # ## Copy images from the main branch @@ -133,9 +133,27 @@ for folder in $sorted_folders; do if [ "$folder" != $release_tag ]; then WEIGHT_VALUE=$((WEIGHT_VALUE + 1)) echo "--- -title: ${folder} +title: ${folder^} weight: ${WEIGHT_VALUE} ---" > $OUTPUT_CONTENT_DIR/$folder/_index.md + +# Do the same for children folders +sorted_children_folders=$(find $OUTPUT_CONTENT_DIR/$folder/ -maxdepth 1 -type d -exec basename {} \; | sort) +CHILDREN_WEIGHT_VALUE=0 + +for children_folder in $sorted_children_folders; do + +## TODO: handle unlimited depth of children folders +# Add _index.md file for the children folder +if [ "$children_folder" != $folder ]; then +CHILDREN_WEIGHT_VALUE=$((CHILDREN_WEIGHT_VALUE + 1)) +echo "--- +title: ${children_folder^} +weight: ${CHILDREN_WEIGHT_VALUE} +---" > $OUTPUT_CONTENT_DIR/$folder/$children_folder/_index.md +fi +done + fi done diff --git a/website/config/_default/hugo.toml b/website/config/_default/hugo.toml index 963302d..edbd0f0 100644 --- a/website/config/_default/hugo.toml +++ b/website/config/_default/hugo.toml @@ -17,13 +17,13 @@ defaultContentLanguage = "en" disableLanguages = ["de", "nl"] defaultContentLanguageInSubdir = false -copyRight = "Copyright (c) 2023 Perses" +copyRight = "Copyright (c) 2024 Perses" [build.buildStats] enable = true [social] -twitter = "" +twitter = "https://twitter.com/PersesDev" [outputs] home = ["HTML", "RSS", "searchIndex"]