Title | Summary | Tags | |||
---|---|---|---|---|---|
wcoder |
caddy markdown |
|
https://caddyserver.com/docs/extending-caddy
caddy markdown server
export SENTRY_DSN="xx"
export SENTRY_DEBUG="true"
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
xcaddy build v2.8.4 --with github.com/kingreatwill/caddy-modules/[email protected]=./markdown \
--with github.com/kingreatwill/caddy-modules/[email protected]=./tracing-sentry \
--with github.com/kingreatwill/caddy-modules/[email protected]=./admin-ui \
--with github.com/kingreatwill/caddy-modules/[email protected]=./search
chmod +x caddy
./caddy run
由于新版使用了quickjs需要开启CGO_ENABLED=1
- simple
- normal
- Custom template files
markdown {
template /markdown.tmpl
}
markdown {
template normal
}
- 增加在线人数
- 文件访问次数
- 显示创建和修改时间
- 显示git提交信息和diff
- 排除文件夹
- 隐藏文件(目前默认以.和_开头的文件不显示)
- SEO
- markdown插件可配置
- sitemap
- 定时更新根目录
- 留言回复(可以对接到issue)
# 获取 git 仓库中所有文件的最新修改时间
$ git ls-tree -r --name-only HEAD | while read filename; do
> echo "$(git log -1 --pretty=format:"%ad" -- $filename) $filename";
> done
# 获取 git 仓库中所有文件的最初创建时间
$ git ls-tree -r --name-only HEAD | while read filename; do
> echo "$(git log --pretty=format:"%ad" -- $filename | tail -1) $filename";
> done
How to retrieve the last modification date of all files in a Git repository
Finding the date/time a file was first added to a Git repository
定时更新根目录
#!/bin/bash
(date "+%Y-%m-%d %H:%M:%S")
cd /data/dockerv/caddy/srv/note.wcoder.com
git pull
#
# crontab -e
# 0 0 * * * sh /root/code/crontab.sh >> /root/code/crontab.log