From 36859acbd4551b6e924bd0fb6310014f3937a5f1 Mon Sep 17 00:00:00 2001 From: Mitchell Burton Date: Mon, 22 Jan 2024 06:34:57 -0800 Subject: [PATCH] merge from upstream/main Squashed commit of the following: commit 26efedfe3f7aa315e3293063808da9e7d938e28e Author: Mitchell Burton Date: Mon Jan 22 06:32:39 2024 -0800 add CRUMBS env var commit b392936cf37f001d960d26103dd0fcb9c7bd0d39 Author: Mitchell Burton Date: Mon Jan 22 06:26:36 2024 -0800 add breadcrumbs nav --- convert.sh | 21 +++++++++++++++++++++ env | 1 + markdown/subpage/non-index.md | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 markdown/subpage/non-index.md diff --git a/convert.sh b/convert.sh index cad5722..ba35f29 100755 --- a/convert.sh +++ b/convert.sh @@ -9,6 +9,22 @@ FILES=$(find ./markdown -type f -name '*.md') rm -rf ./_site +generate_crumbs() { + HTML_PATH="$1" + PARTS=$(echo "$HTML_PATH" | sed -e 's/\(\/index\)\.html$//' | cut -d'/' -f3- | sed -e 's/\// /g') + + echo '" >> "$HTML_PATH" +} + convert_file() { HTML_PATH=$(echo "$1" | sed -e 's/\.md$/\.html/' | sed -e 's/^\.\/markdown/\.\/_site/') @@ -26,6 +42,11 @@ convert_file() { sed -e "s:{{SITE_ROOT}}:$SITE_ROOT:g" ./templates/base.html | \ sed -e "s:{{PAGE_TITLE}}:$PAGE_TITLE:g" \ > "$HTML_PATH" + + if [ "$CRUMBS" = "YES" ]; then + generate_crumbs "$HTML_PATH" + fi + markdown --html4tags "$1" >> "$HTML_PATH" cat ./templates/close.html >> "$HTML_PATH" } diff --git a/env b/env index 9312de3..011abb6 100644 --- a/env +++ b/env @@ -1,2 +1,3 @@ export SITE_ROOT="/blog" export SITE_TITLE="Perfect5th 2.0" +export CRUMBS="YES" diff --git a/markdown/subpage/non-index.md b/markdown/subpage/non-index.md new file mode 100644 index 0000000..c4a1769 --- /dev/null +++ b/markdown/subpage/non-index.md @@ -0,0 +1,4 @@ +# Non Index page + +This is a page that is not the index of the directory it is in. +