mirror of
https://github.com/kou029w/_.git
synced 2025-01-30 13:58:08 +00:00
create caddy-md
This commit is contained in:
parent
e353a7db6a
commit
c8b2ae0f07
5 changed files with 38 additions and 0 deletions
5
caddy-md/Caddyfile
Normal file
5
caddy-md/Caddyfile
Normal file
|
@ -0,0 +1,5 @@
|
|||
:8080 {
|
||||
file_server
|
||||
templates
|
||||
try_files {path} /
|
||||
}
|
8
caddy-md/compose.yml
Normal file
8
caddy-md/compose.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
services:
|
||||
caddy:
|
||||
image: caddy
|
||||
ports:
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile
|
||||
- ./srv:/srv
|
1
caddy-md/srv/a.md
Normal file
1
caddy-md/srv/a.md
Normal file
|
@ -0,0 +1 @@
|
|||
# あ
|
15
caddy-md/srv/index.html
Normal file
15
caddy-md/srv/index.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
{{- $path := .OriginalReq.URL.Path}}
|
||||
{{- if hasSuffix "/" $path}}{{$path = print $path "index"}}{{end}}
|
||||
{{- $path = print $path ".md"}}
|
||||
{{- if not (fileExists $path)}}{{httpError 404}}{{end}}
|
||||
{{- $markdown := (include $path | splitFrontMatter)}}
|
||||
{{- $title := default (trimSuffix ".md" (base $path)) $markdown.Meta.title}}
|
||||
<html lang="ja">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{$title}}</title>
|
||||
|
||||
{{markdown $markdown.Body | trim}}
|
||||
|
||||
</html>
|
9
caddy-md/srv/index.md
Normal file
9
caddy-md/srv/index.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
title: トップ
|
||||
---
|
||||
|
||||
# トップページ
|
||||
|
||||
こんにちは、世界
|
||||
|
||||
- [a](a)
|
Loading…
Add table
Reference in a new issue