Skip to content

Instantly share code, notes, and snippets.

@H2NCH2COOH
Last active June 14, 2022 03:08
Show Gist options
  • Save H2NCH2COOH/208d4d6704fb9f811799cd8455827482 to your computer and use it in GitHub Desktop.
Save H2NCH2COOH/208d4d6704fb9f811799cd8455827482 to your computer and use it in GitHub Desktop.
Markdown in Nginx

Markdown in Nginx

Nginx config

location ~ /.*\.md {
    root /www/;
    default_type text/html;
    charset UTF-8;
    add_before_body /strapdown/prepend;
    add_after_body /strapdown/postpend;
}

location /strapdown/ {
    root /www/;
}

/www/strapdown/prepend

<!DOCTYPE html>
<html>
<xmp theme="united" style="display:none;">

/www/strapdown/postpend

</xmp>
<script src="https://strapdownjs.com/v/0.2/strapdown.js"></script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment