Last active
August 29, 2017 19:41
-
-
Save tsaarni/67222455916ac38d94e8 to your computer and use it in GitHub Desktop.
Configure Apache to render markdown files automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# To make apache render files ending with .md with strapdown.js | |
# markdown renderer (http://strapdownjs.com/), add following lines | |
# to /etc/apache2/httpd.conf: | |
# | |
# Action markdown /cgi-bin/strapdown.cgi | |
# AddHandler markdown .md | |
# DirectoryIndex index.html index.md | |
# | |
# then enable mod_actions by running "a2enmod actions" and store | |
# this script to cgi-bin directory as file strapdown.cgi. Finally | |
# restart apache. | |
# | |
cat <<DOCUMENT | |
Content-type: text/html | |
<!DOCTYPE html> | |
<html> | |
<title>$(basename "$PATH_INFO")</title> | |
<xmp theme="united" style="display:none;"> | |
$(cat "$PATH_TRANSLATED") | |
</xmp> | |
<script src="//strapdownjs.com/v/0.2/strapdown.js"></script> | |
</html> | |
DOCUMENT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/cgi-bin/strapdown.cgi/images/wintile/README.md
was not found on this server.:(