commit 1f0ac499f8571b8da798dbd8e78c60fe55bbeed0 Author: silverwizard Date: Tue Oct 1 15:48:22 2024 -0400 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46c3855 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dest/ diff --git a/local.env b/local.env new file mode 100644 index 0000000..766af0f --- /dev/null +++ b/local.env @@ -0,0 +1,7 @@ +BASEDIR="/home/silverwizard/Generator/" +SRC="$BASEDIR/src" +STATIC="$BASEDIR/static" +TEMPLATES="$BASEDIR/templates" +DEST="/var/www/htdocs" + +export BASEDIR SRC STATIC TEMPLATES DEST diff --git a/mark.sh b/mark.sh new file mode 100755 index 0000000..59494e6 --- /dev/null +++ b/mark.sh @@ -0,0 +1,23 @@ +IFS=' +' +cat templates/header.html > dest/index.html +for file in `find src -type f -name "*.md"` +do + src=$file + dest=`echo $file |sed -e 's/^src/dest/' -e 's/md$/html/'` + echo "SRC: $src DEST: $dest" + cat templates/header.html > $dest + + cat templates/cardbegin.html >> $dest + markdown_py $src >> $dest + sh templates/date.sh $src >> $dest + cat templates/cardend.html >> $dest + + cat templates/cardbegin.html >> dest/index.html + markdown_py $src >> dest/index.html + sh templates/date.sh $src >> dest/index.html + cat templates/cardend.html >> dest/index.html + + cat templates/footer.html >> $dest +done +cat templates/footer.html >> dest/index.html diff --git a/src/hibeck.md b/src/hibeck.md new file mode 100644 index 0000000..1b3db00 --- /dev/null +++ b/src/hibeck.md @@ -0,0 +1,3 @@ +# This should be new! + +Heya Becky and Robo! diff --git a/src/test.md b/src/test.md new file mode 100644 index 0000000..01bc18b --- /dev/null +++ b/src/test.md @@ -0,0 +1,3 @@ +# This is a test + +I am trying to create a blogpost - but I don't know what I'm doing diff --git a/src/test2.md b/src/test2.md new file mode 100644 index 0000000..b520045 --- /dev/null +++ b/src/test2.md @@ -0,0 +1,3 @@ +# I should have a title + +I want to do another test diff --git a/static.sh b/static.sh new file mode 100755 index 0000000..a3bf23d --- /dev/null +++ b/static.sh @@ -0,0 +1,6 @@ +#!/bin/sh +. ./local.env +cd $BASEDIR +sh mark.sh +cp static/* dest/ +cp dest/* $DEST diff --git a/static/style.css b/static/style.css new file mode 100644 index 0000000..dd94853 --- /dev/null +++ b/static/style.css @@ -0,0 +1,56 @@ +* { + box-sizing: border-box; + columns: 2 auto; + columns: auto 12em; + columns: auto auto; +} + +body { + font-family: Arial; + padding: 20px; + background: #f1f1f1; +} + +h1 { + padding: 30px; + font-size: 40px; + text-align: center; + background: white; +} + +.leftcolumn { + float: left; + width: 75%; +} + +.rightcolumn { + float: left; + width: 25%; + padding-left: 20px; +} + +.card { + background-color: white; + padding: 20px; + margin-top: 20px; +} + +.row:after { + content: ""; + display: table; + clear: both; +} + +.footer { + padding: 20px; + text-align: center; + background: #ddd; + margin-top: 20px; +} + +@media screen and (max-width: 800px) { + .leftcolumn, .rightcolumn { + width: 100%; + padding: 0; + } +} diff --git a/templates/cardbegin.html b/templates/cardbegin.html new file mode 100644 index 0000000..498dd5c --- /dev/null +++ b/templates/cardbegin.html @@ -0,0 +1,2 @@ +
+
diff --git a/templates/cardend.html b/templates/cardend.html new file mode 100644 index 0000000..bdd6bc9 --- /dev/null +++ b/templates/cardend.html @@ -0,0 +1,2 @@ +
+
diff --git a/templates/date.sh b/templates/date.sh new file mode 100755 index 0000000..1986892 --- /dev/null +++ b/templates/date.sh @@ -0,0 +1 @@ +echo "
Post Dated: `stat -f %Sm $1`
" diff --git a/templates/footer.html b/templates/footer.html new file mode 100644 index 0000000..0aecc91 --- /dev/null +++ b/templates/footer.html @@ -0,0 +1,8 @@ + +
+
+

Who Am I

+

I'm a hacker who is trying to survive the Software Crisis

+
+
+ diff --git a/templates/header.html b/templates/header.html new file mode 100644 index 0000000..83dad33 --- /dev/null +++ b/templates/header.html @@ -0,0 +1,4 @@ + + +

A Meditation On Hating Security

+