Browse Source

Streamlined webgen2.sh operations

devel
Jean 2 months ago
parent
commit
98aea3f0e8
1 changed files with 1 additions and 11 deletions
  1. +1
    -11
      webgen2.sh

+ 1
- 11
webgen2.sh View File

@@ -7,7 +7,7 @@ WEB_ROOT="${BASE_DIR}/website"
TEMPLATE_DIR="${BASE_DIR}/templates"
TEMPLATE_HTML="${TEMPLATE_DIR}/html/nextgen.html"

for MARKDOWN_FILE in ${TEMPLATE_DIR}/markdown/*.md; do
for MARKDOWN_FILE in $(find -P ${TEMPLATE_DIR}/markdown/ | grep '.md'); do
PAGE_DIR="$(cat ${MARKDOWN_FILE} | grep 'page_dir' | sed -e 's|page_dir: ||')"

if [[ ! -d "${WEB_ROOT}${PAGE_DIR}" ]]; then
@@ -16,13 +16,3 @@ for MARKDOWN_FILE in ${TEMPLATE_DIR}/markdown/*.md; do

pandoc --from markdown --to html --template "${TEMPLATE_HTML}" --output "${WEB_ROOT}${PAGE_DIR}index.html" "${MARKDOWN_FILE}" # pandoc does its magic here
done

for MARKDOWN_FILE in ${TEMPLATE_DIR}/markdown/blog/*.md; do
PAGE_DIR="$(cat ${MARKDOWN_FILE} | grep 'page_dir' | sed -e 's|page_dir: ||')"

if [[ ! -d "${WEB_ROOT}${PAGE_DIR}" ]]; then
mkdir -p "${WEB_ROOT}${PAGE_DIR}" # Makes the folder the current page being (re)generated goes in if it does not already exist.
fi

pandoc --from markdown --to html --template "${TEMPLATE_HTML}" --output "${WEB_ROOT}${PAGE_DIR}index.html" "${MARKDOWN_FILE}" # pandoc does its magic here
done

Loading…
Cancel
Save