Skip to content

Latest commit

 

History

History
96 lines (76 loc) · 2.29 KB

README.md

File metadata and controls

96 lines (76 loc) · 2.29 KB
Title Summary Tags
wcoder
caddy markdown
markdown
caddy
sentry

caddy-modules

https://caddyserver.com/docs/extending-caddy

markdown

caddy markdown server

debug

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

template

  1. simple
  2. normal
  3. Custom template files
markdown {
    template /markdown.tmpl
}

markdown {
    template normal
}

preview

https://note.wcoder.com/

TODO

  • 增加在线人数
  • 文件访问次数
  • 显示创建和修改时间
  • 显示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

crontab

定时更新根目录

#!/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