commit 976dc1adcf2d2511e07105f387b960024245bd04 Author: juju2143 Date: Sun Sep 17 23:45:31 2023 -0400 First commit diff --git a/template.html b/template.html new file mode 100644 index 0000000..1bedcee --- /dev/null +++ b/template.html @@ -0,0 +1,170 @@ +$--| GitHub HTML5 Pandoc Template" v2.2 | 2020/08/12 | pandoc v2.1.1 + + +$-------------------------------------------------------------------------> lang + + +$--============================================================================= +$-- METADATA +$--============================================================================= + + + +$-----------------------------------------------------------------------> author +$for(author-meta)$ + +$endfor$ +$-------------------------------------------------------------------------> date +$if(date-meta)$ + +$endif$ +$---------------------------------------------------------------------> keywords +$if(keywords)$ + +$endif$ +$------------------------------------------------------------------> description +$if(description)$ + +$endif$ +$------------------------------------------------------------------------> title + $if(title-prefix)$$title-prefix$ – $endif$$pagetitle$ +$--=========================================================================== +$-- CSS STYLESHEETS +$--=========================================================================== +$-- Here comes the placeholder (within double braces) that will be replaced +$-- by the CSS file in the finalized template: + +$------------------------------------------------------------------------------- + +$------------------------------------------------------------------------------- +$if(quotes)$ + +$endif$ +$-------------------------------------------------------------> highlighting-css +$if(highlighting-css)$ + +$endif$ +$--------------------------------------------------------------------------> css +$for(css)$ + +$endfor$ +$-------------------------------------------------------------------------> math +$if(math)$ + $math$ +$endif$ +$------------------------------------------------------------------------------- + +$--------------------------------------------------------------> header-includes +$for(header-includes)$ + $header-includes$ +$endfor$ +$------------------------------------------------------------------------------- + + +
+$---------------------------------------------------------------> include-before +$for(include-before)$ +$include-before$ +$endfor$ +$-->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> IF: title +$if(title)$ +
+

$title$

+$---------------------------------------------------------------------> subtitle +$if(subtitle)$ +

$subtitle$

+$endif$ +$-----------------------------------------------------------------------> author +$for(author)$ +

$author$

+$endfor$ +$-------------------------------------------------------------------------> date +$if(date)$ +

$date$

+$endif$ +$----------------------------------------------------------------------> summary +$if(summary)$ +
+$summary$ +
+$endif$ +$------------------------------------------------------------------------------- +
+$endif$ +$--<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< END IF: title +$--------------------------------------------------------------------------> toc +$if(toc)$ +
+ +
+$endif$ +$-------------------------------------------------------------------------> body +$body$ +$----------------------------------------------------------------> include-after +$for(include-after)$ +$include-after$ +$endfor$ +$------------------------------------------------------------------------------- +
+edit - +history - +home +
+ + diff --git a/wiki.sh b/wiki.sh new file mode 100755 index 0000000..4a192c0 --- /dev/null +++ b/wiki.sh @@ -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