Skip to content

Commit 5e0cc81

Browse files
committed
优先使用内置的 index.html
1 parent 0e3448e commit 5e0cc81

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/render/page_home.go

+9
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ func (p *BookRendor) renderHomepage() error {
1818
goldmark.WithExtensions(extension.GFM),
1919
)
2020

21+
// 已经有 html 文件
22+
if html, err := os.ReadFile(filepath.Join(p.Book.Root, "index.html")); err == nil {
23+
return os.WriteFile(
24+
filepath.Join(p.Book.Root, "book", "index.html"),
25+
html,
26+
0666,
27+
)
28+
}
29+
2130
// 读取首页
2231
page_Content, err := os.ReadFile(filepath.Join(p.Book.Root, "index.md"))
2332
if err != nil {

0 commit comments

Comments
 (0)