summaryrefslogtreecommitdiff
path: root/modules/cgit/files/filters/hugo-pre.sh
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2021-12-29 20:13:55 +0100
commitd04542e000b8f8fadce45af96d93fb904ca99115 (patch)
treee85ee2bb0472d9f83f051f31d2629bf4c96bb755 /modules/cgit/files/filters/hugo-pre.sh
parentSetup new site.pp. (diff)
parentMigrate stuff from ansible. (diff)
downloadwebdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.gz
webdav_server-d04542e000b8f8fadce45af96d93fb904ca99115.tar.xz
Merge branch 'master' of /home/hugo/puppet into production
Diffstat (limited to 'modules/cgit/files/filters/hugo-pre.sh')
-rwxr-xr-xmodules/cgit/files/filters/hugo-pre.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/cgit/files/filters/hugo-pre.sh b/modules/cgit/files/filters/hugo-pre.sh
new file mode 100755
index 0000000..b716525
--- /dev/null
+++ b/modules/cgit/files/filters/hugo-pre.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+name=$1
+
+extension=${name: -3}
+
+case $extension in
+ .md) pandoc -f gfm -t html ;;
+ *)
+ cat <<- EOF
+ <pre>$(cat -)</pre>
+ EOF
+ ;;
+esac
+