From: Mike D. Lowis Date: Mon, 10 Aug 2015 17:00:07 +0000 (-0400) Subject: Added script to autogenerate the menu bar X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=464952e8c610184838cb461ff9cd679f2a10a389;p=projs%2Fmdlowis.com.git Added script to autogenerate the menu bar --- diff --git a/config.sh b/config.sh index 79a54d9..90bb5c0 100644 --- a/config.sh +++ b/config.sh @@ -3,4 +3,5 @@ export TITLE="Simplicity is the ultimate sophistication" export SUBTITLE=$TITLE export COPYRIGHT="© 2015 Michael D. Lowis" +export MENUTEXT="`genmenu.sh`" diff --git a/gensite b/gensite new file mode 100755 index 0000000..5ae68b0 --- /dev/null +++ b/gensite @@ -0,0 +1,5 @@ +#!/bin/bash + +pages=(`ls pages/*.md | sed -e 's/\.md$//'`) + +echo ${pages[@]} diff --git a/pages/articles.md b/pages/articles.md new file mode 100644 index 0000000..cc019f4 --- /dev/null +++ b/pages/articles.md @@ -0,0 +1,2 @@ +MENUID 1 + diff --git a/pages/home.md b/pages/home.md index 80b506c..7f8275f 100644 --- a/pages/home.md +++ b/pages/home.md @@ -1,4 +1,5 @@ TYPE page +MENUID 0 --- # Header 1 diff --git a/pages/projects.md b/pages/projects.md new file mode 100644 index 0000000..8d71e28 --- /dev/null +++ b/pages/projects.md @@ -0,0 +1,2 @@ +MENUID 2 + diff --git a/pages/prototypes.md b/pages/prototypes.md new file mode 100644 index 0000000..3a3ae70 --- /dev/null +++ b/pages/prototypes.md @@ -0,0 +1,2 @@ +MENUID 3 + diff --git a/site/articles.html b/site/articles.html new file mode 100644 index 0000000..e69de29 diff --git a/site/home.html b/site/home.html index 402e15c..904522c 100644 --- a/site/home.html +++ b/site/home.html @@ -10,16 +10,24 @@
mdlowis - Simplicity is the ultimate sophistication + Simplicity
diff --git a/tools/genmenu.sh b/tools/genmenu.sh new file mode 100755 index 0000000..17614a8 --- /dev/null +++ b/tools/genmenu.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +pushd pages/ > /dev/null +pagelist=(`grep MENUID *.md | sed -e's/\.md:MENUID//' | awk '{print $2, $1}' | sort | cut -d' ' -f2`) + +echo '' +for page in "${pagelist[@]}"; do + echo " $page" +done +echo ' ' +popd > /dev/null + diff --git a/tools/genpage b/tools/genpage index 54577c0..0bee9cf 100755 --- a/tools/genpage +++ b/tools/genpage @@ -22,8 +22,8 @@ ifile=${1:?"missing filename"} ofile="contents.${0##*/}-$$" touch $ofile eval `awk -v OFILE="$ofile" "$awk_script" $ifile` -export CONTENT=`md2html.awk $ofile` -source config.sh +export CONTENT="`md2html.awk $ofile`" +. ./config.sh if [ -f "templates/$TYPE.html" ]; then mo "templates/$TYPE.html" fi