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. +