Updated variable names to lower/camel case

This commit is contained in:
2026-05-22 22:41:54 -04:00
parent cb1add90ea
commit 8dc7f8361f
4 changed files with 39 additions and 39 deletions
+10 -10
View File
@@ -2,27 +2,27 @@
set -euo pipefail
BASEDIR="$(dirname "${0}" | sed "s|^\.|${PWD}|")"
baseDir="$(realpath "$(dirname "${0}")")"
source "${BASEDIR}/website.conf"
source "${baseDir}/website.conf"
for MARKDOWN_FILE in $(find -P "${MARKDOWN_DIR}/" | grep '\.md'); do
PAGE_DIR="${WEBROOT}/$(cat "${MARKDOWN_FILE}" | grep -m1 '^page_dir: ' | head -1 | sed 's|page_dir: ||; s|^/||')"
TEMPLATE="${TEMPLATE_DIR}/$(cat "${MARKDOWN_FILE}" | grep -m1 '^template: ' | head -1 | sed 's|template: ||').html"
for markdownFile in $(find -P "${markdownDir}/" | grep '\.md'); do
pageDir="${webroot}/$(cat "${markdownFile}" | grep -m1 '^page_dir: ' | head -1 | sed 's|page_dir: ||; s|^/||')"
template="${templateDir}/$(cat "${markdownFile}" | grep -m1 '^template: ' | head -1 | sed 's|template: ||').html"
if [[ ! -d "${PAGE_DIR}/" ]]; then
if [[ ! -d "${pageDir}/" ]]; then
# Makes the folder the current page being (re)generated goes in if it does not already exist.
mkdir \
-p \
"${PAGE_DIR}/"
"${pageDir}/"
fi
# pandoc does its magic here
pandoc \
--from markdown \
--to html \
--template "${TEMPLATE}" \
--output "${PAGE_DIR}/index.html" \
"${MARKDOWN_FILE}"
--template "${template}" \
--output "${pageDir}/index.html" \
"${markdownFile}"
done