feat: Add Learn-Number tool for preschool math practice and refactor HTML components
Build and Push Docker Image / build (push) Successful in 2m55s
Build and Push Docker Image / build (push) Successful in 2m55s
This commit is contained in:
+3
-2
@@ -11,6 +11,7 @@ import (
|
||||
"os"
|
||||
"strconv"
|
||||
"toolbox/pkg/base"
|
||||
_ "toolbox/pkg/learnnumber"
|
||||
_ "toolbox/pkg/zitie" // 匿名导入以触发 init()
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -55,8 +56,8 @@ func main() {
|
||||
r.StaticFS("/static", http.FS(subFS))
|
||||
|
||||
// 3. 模板引擎初始化
|
||||
// 关键修复:先 Sub 再 Parse,确保路径匹配
|
||||
tmpl, err := template.ParseFS(subFS, "layout.html", "index.html")
|
||||
// 递归加载 web 目录下所有的 .html 文件
|
||||
tmpl, err := template.ParseFS(subFS, "layout.html", "index.html", "tools/*.html")
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to parse templates: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user