update:README.md
This commit is contained in:
parent
0ff943781b
commit
2af1b8b00e
27
README.md
27
README.md
|
@ -1,3 +1,26 @@
|
||||||
# Caddy Webp
|
# Caddy Webp
|
||||||
Automatically convert JPG/PNGs to webp format
|
Caddy2插件——无感的将图片转换为WebP格式。
|
||||||
[Learn more on caddy doc](https://caddyserver.com/v1/docs/http.webp)
|
|
||||||
|
# Get Start
|
||||||
|
[release](https://github.com/zhshch2002/caddy-webp/releases)里有我编译的linux-amd64的Caddy可执行文件,其他的平台如下:
|
||||||
|
1. 克隆本仓库
|
||||||
|
2. `go build ./caddy/main.go`
|
||||||
|
3. 将编译得到的新文件替换Caddy原始`/usr/bin/caddy`
|
||||||
|
4. 修改Caddyfile
|
||||||
|
|
||||||
|
```
|
||||||
|
{ # 全局块
|
||||||
|
order webp before file_server # 设置Handler激活顺序,缺少将无法启动caddy
|
||||||
|
}
|
||||||
|
|
||||||
|
localhost {
|
||||||
|
root * /var/www/
|
||||||
|
encode gzip
|
||||||
|
webp # <= webp插件在这里启动了!
|
||||||
|
file_server
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
![](./screenshot.png)
|
||||||
|
|
||||||
|
Just for fun!
|
Loading…
Reference in New Issue