summaryrefslogtreecommitdiff
path: root/make.sh
diff options
context:
space:
mode:
authormion <>2026-02-11 22:59:23 +0000
committermion <>2026-02-11 22:59:23 +0000
commit9ac5ed19e543f15aff7ce2f426b1444867fd1b21 (patch)
treef6e798dfa86336ca48d79e6a8a23ce1e51b72faa /make.sh
test
Diffstat (limited to 'make.sh')
-rwxr-xr-xmake.sh87
1 files changed, 87 insertions, 0 deletions
diff --git a/make.sh b/make.sh
new file mode 100755
index 0000000..50e559d
--- /dev/null
+++ b/make.sh
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+rm -r html
+mkdir html
+
+cp -r media html
+cp stylesheets/*.css html
+cp *.php html
+cp *.js html
+# cp favicon.ico html
+
+# Generate Pages
+
+echo "generating pages..."
+
+cd content
+
+pages=".pages"
+
+echo "<div class="box">\n" >> $pages
+echo "### Last 10 Modified Pages:\n" >> $pages
+
+for page in $(ls *.* -t | head -10); do # todo: use git for this (if its better)
+ name=${page%.md}
+ echo "* **[$name]($name.html)** - <small>$(date -r $page "+%d/%m/%y")</small>" >> $pages
+done
+
+echo "</div>" >> $pages
+
+# echo "<div class="box">\n" >> $pages
+# echo "### Last 10 Recently Created Pages:\n" >> $pages
+
+# for page in $(ls *.* -t --time=birth | head -10); do
+# name=${page%.md}
+# echo "* **[$name]($name.html)**" >> $pages
+# done
+
+# echo "</div>" >> $pages
+
+echo "\n### All Pages:\n" >> $pages
+
+first=true
+
+for page in *.*; do
+
+ name=${page%.md}
+
+ if [ "$first" = true ]; then
+ first=false
+ else
+ echo " // " >> $pages
+ fi
+
+ echo "**[$name]($name.html)**" >> $pages
+
+done
+
+# Excluded pages.md from last modified, as it will always be the last modified D:
+mv $pages pages.md
+
+for page in *.md; do
+ name="${page%.md}"
+ title="$(echo $name | sed "s/_/ /g")"
+ pagename="../html/$name.html"
+
+ if [ "$name" = "index" ]; then
+ sed -e "s|{{ page }}||g" -e "s|{{ title }}|neetlo.li|g" ../template.html >> $pagename
+ else
+ sed -e "s|{{ page }}|\&gt;\&lt;\&gt; $title|g" -e "s|{{ title }}|$title|g" ../template.html >> $pagename
+ fi
+
+ cmark-gfm --unsafe -e table -e autolink $page >> $pagename
+
+ echo "<hr>Last Modified: $(date -r "$page" "+%B %d, %Y")" >> $pagename
+
+ echo "</main></body></html>" >> $pagename
+done
+
+rm pages.md
+
+cd ..
+
+echo "generated pages"
+
+
+
+