]> git.mdlowis.com Git - projs/mdlowis.com.git/commitdiff
added POC new generation structure and script
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 2 Jul 2018 19:50:47 +0000 (15:50 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 2 Jul 2018 19:50:47 +0000 (15:50 -0400)
newgen.sh [new file with mode: 0755]
src/about.md [new file with mode: 0644]
src/archive.md [new file with mode: 0644]
src/articles/2018/07/02/01-article.md [new file with mode: 0644]
src/articles/index.md [new file with mode: 0644]
src/projects/index.md [new file with mode: 0644]
src/prototypes/index.md [new file with mode: 0644]

diff --git a/newgen.sh b/newgen.sh
new file mode 100755 (executable)
index 0000000..1f12c84
--- /dev/null
+++ b/newgen.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+SRCDIR="$1"
+DESTDIR="$2"
+
+genpage(){
+    src="$1"
+    dest="$2"
+
+    if [[ -d "$src" ]]; then
+        echo "dir: '$src'"
+    else
+        ofile="$dest/${src#src/}"
+        ofile="${ofile%.*}.html"
+        dest="${ofile%/*}"
+        echo "page: $src -> $ofile"
+        mkdir -p "$dest"
+        tools/md2html.awk "$src" > "$ofile"
+    fi
+}
+
+for p in $(find "$SRCDIR" -mindepth 1 -maxdepth 1); do
+    genpage "$p" "$DESTDIR"
+done
+
diff --git a/src/about.md b/src/about.md
new file mode 100644 (file)
index 0000000..4b51d64
--- /dev/null
@@ -0,0 +1 @@
+# About
diff --git a/src/archive.md b/src/archive.md
new file mode 100644 (file)
index 0000000..35e44e5
--- /dev/null
@@ -0,0 +1 @@
+# Archive
diff --git a/src/articles/2018/07/02/01-article.md b/src/articles/2018/07/02/01-article.md
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/articles/index.md b/src/articles/index.md
new file mode 100644 (file)
index 0000000..7b0fca0
--- /dev/null
@@ -0,0 +1 @@
+# Articles
diff --git a/src/projects/index.md b/src/projects/index.md
new file mode 100644 (file)
index 0000000..5340998
--- /dev/null
@@ -0,0 +1 @@
+# Projects
diff --git a/src/prototypes/index.md b/src/prototypes/index.md
new file mode 100644 (file)
index 0000000..6c06dec
--- /dev/null
@@ -0,0 +1 @@
+# Prototypes