Skip to content

Commit

Permalink
render markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Sep 5, 2024
1 parent fbb8f04 commit 11318fa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ services:
virtual.proxy.matcher: /leaderboard*
# /data -> caddy:/share/petric
virtual.host.directives: |
# render markdown
@mdfile path_regexp /data/(.+\.md)$
handle @mdfile {
root * /share/petric
header Content-Type text/html
templates
respond <<HTML
<!DOCTYPE html>
<html><head><title>{{placeholder "http.regexp.mdfile.1" | base}}</title></head>
<body><a href=".">{{placeholder "http.regexp.mdfile.1" | dir}}/</a>{{placeholder "http.regexp.mdfile.1" | base}}<hr/>
{{placeholder "http.regexp.mdfile.1" | readFile | markdown}}
</body></html>
HTML 200
}
@notget not method GET
handle_path /data* {
root * /share/petric
Expand Down

0 comments on commit 11318fa

Please sign in to comment.