From 95f8da2d6cebb70c2b2fb4313e2991d6f8d2c4ba Mon Sep 17 00:00:00 2001 From: axiaoxin <254606826@qq.com> Date: Sun, 6 Jun 2021 17:52:49 +0800 Subject: [PATCH] update statics --- config.default.toml | 2 +- statics/{files => }/css/README.md | 0 statics/{files => }/html/README.md | 0 statics/{files => }/img/README.md | 0 statics/{files => }/js/README.md | 0 statics/statics.go | 10 ++++------ 6 files changed, 5 insertions(+), 7 deletions(-) rename statics/{files => }/css/README.md (100%) rename statics/{files => }/html/README.md (100%) rename statics/{files => }/img/README.md (100%) rename statics/{files => }/js/README.md (100%) diff --git a/config.default.toml b/config.default.toml index 4d17058..1ac0073 100644 --- a/config.default.toml +++ b/config.default.toml @@ -29,7 +29,7 @@ env = "localhost" ########## 静态文件相关配置 [statics] # 网页模板路径 - tmplpath = "files/html/*" + tmplpath = "html/*" # 静态文件 URL 路径,网页中通过 /statics/js/xx.js 访问资源, url = "/statics" diff --git a/statics/files/css/README.md b/statics/css/README.md similarity index 100% rename from statics/files/css/README.md rename to statics/css/README.md diff --git a/statics/files/html/README.md b/statics/html/README.md similarity index 100% rename from statics/files/html/README.md rename to statics/html/README.md diff --git a/statics/files/img/README.md b/statics/img/README.md similarity index 100% rename from statics/files/img/README.md rename to statics/img/README.md diff --git a/statics/files/js/README.md b/statics/js/README.md similarity index 100% rename from statics/files/js/README.md rename to statics/js/README.md diff --git a/statics/statics.go b/statics/statics.go index c757598..94b18bf 100644 --- a/statics/statics.go +++ b/statics/statics.go @@ -1,10 +1,8 @@ -// Package statics 静态文件嵌入 +// Package statics embed 静态文件 package statics import "embed" -var ( - // Files 静态文件嵌入 - //go:embed files/* - Files embed.FS -) +// Files 静态文件资源 +//go:embed css/* font/* html/* img/* js/* +var Files embed.FS