mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
Compare commits
3 commits
7972931280
...
efb63927e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efb63927e9 | ||
|
|
a285777217 | ||
|
|
44cc5d5677 |
3 changed files with 17 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
# 更新日志
|
||||
|
||||
4.3.2 - 2025-08-20
|
||||
---
|
||||
- FIX: 修正`cfg.Pages.StaticDir`为空时的处置
|
||||
|
||||
4.3.1 - 2025-08-13
|
||||
---
|
||||
- CHANGE: 更新至[Go 1.25](https://tip.golang.org/doc/go1.25)
|
||||
|
|
|
|||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
4.3.1
|
||||
4.3.2
|
||||
14
main.go
14
main.go
|
|
@ -234,8 +234,18 @@ func setupPages(cfg *config.Config, r *touka.Engine) {
|
|||
}
|
||||
|
||||
case "external":
|
||||
r.SetUnMatchFS(http.Dir(cfg.Pages.StaticDir))
|
||||
|
||||
if cfg.Pages.StaticDir == "" {
|
||||
logger.Errorf("Pages Mode is 'external' but StaticDir is empty. Using embedded pages instead.")
|
||||
err := setInternalRoute(cfg, r)
|
||||
if err != nil {
|
||||
logger.Errorf("Failed to load embedded pages: %s", err)
|
||||
fmt.Printf("Failed to load embedded pages: %s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
} else {
|
||||
extPageFS := os.DirFS(cfg.Pages.StaticDir)
|
||||
r.SetUnMatchFS(http.FS(extPageFS))
|
||||
}
|
||||
default:
|
||||
// 处理无效的Pages Mode
|
||||
logger.Warnf("Invalid Pages Mode: %s, using default embedded theme", cfg.Pages.Mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue