Skip to content

Commit

Permalink
render markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Sep 4, 2024
1 parent fbb8f04 commit 20f168c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,23 @@ services:
virtual.proxy.matcher: /leaderboard*
# /data -> caddy:/share/petric
virtual.host.directives: |
# render markdown
@datamd path_regexp /data/(.*\.md)$
handle @datamd {
root * /share/petric
header Content-Type text/html
templates
respond <<HTML
<!DOCTYPE html>
<html>
<head><title>{re.datamd.1}</title></head>
<body>
{{slice (splitList "/" .OriginalReq.URL.Path) 2 | join "/" | readFile | markdown}}
</body>
</html>
HTML 200
}
@notget not method GET
handle_path /data* {
root * /share/petric
Expand Down

0 comments on commit 20f168c

Please sign in to comment.