Skip to content

Commit

Permalink
[ENCHANCEMENT] Clean DAC navbar + uppercase first char in title (#24)
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume LADORME <[email protected]>
  • Loading branch information
Gladorme authored Apr 11, 2024
1 parent 88f4bda commit 8d9d6cd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: synchronize
synchronize:
@sh ./scripts/synchronize.sh
@bash ./scripts/synchronize.sh

.PHONY: website-install-depenencies
website-install-depenencies:
Expand Down
24 changes: 21 additions & 3 deletions scripts/synchronize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ 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
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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions website/config/_default/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 8d9d6cd

Please sign in to comment.