a39
/
wiki
1
0
Fork 0

First commit

This commit is contained in:
Yuki 2023-09-17 23:45:31 -04:00
commit 976dc1adcf
2 changed files with 191 additions and 0 deletions

170
template.html Normal file

File diff suppressed because one or more lines are too long

21
wiki.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
PAGE=${REQUEST_URI#/}
if [ -z $PAGE ]
then
PAGE=Home
fi
pandoc="pandoc -f gfm -t html -s --template=$TEMPLATE -V title-prefix:$SITE_TITLE -V pagetitle:$PAGE"
git show HEAD:"$PAGE".md > /dev/null
if [ $? == 0 ]
then
echo HTTP/1.0 200 OK
echo
git show HEAD:"$PAGE".md | $pandoc
else
echo HTTP/1.0 404 Not found
echo
echo "This page does not exist. [Click here]($REPO_URL/wiki/$PAGE?action=_new) to create it." | $pandoc
fi