From b87a1b4a1c318f89538165758d2e8a1d22671a2e Mon Sep 17 00:00:00 2001 From: xing Date: Thu, 4 May 2023 20:37:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=85=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {internal => app}/plugins/comment.go | 4 ++-- {internal => app}/plugins/digest.go | 6 ++--- {internal => app}/plugins/gravatar.go | 2 +- {internal => app}/plugins/pagination.go | 0 .../plugins/wphandle/enlightjs/enlighterjs.go | 10 ++++---- {internal => app}/plugins/wphandle/handle.go | 15 ++++++------ .../wphandle/hiddenlogin/hiddenlogin.go | 4 ++-- .../plugins/wphandle/tests/tt.go | 4 ++-- {internal => app}/plugins/wpposts/posts.go | 2 +- {internal => app}/theme/fs.go | 0 {internal => app}/theme/hook.go | 4 ++-- {internal => app}/theme/templateFuncs.go | 4 ++-- {internal => app}/theme/theme.go | 8 +++---- .../theme/twentyfifteen/colorscheme.json | 0 .../theme/twentyfifteen/colorschemecss.go | 2 +- .../theme/twentyfifteen/custombackground.go | 2 +- .../theme/twentyfifteen/customheader.go | 6 ++--- .../theme/twentyfifteen/layout/base.gohtml | 0 .../theme/twentyfifteen/layout/empty.gohtml | 0 .../theme/twentyfifteen/layout/footer.gohtml | 0 .../theme/twentyfifteen/layout/head.gohtml | 0 .../theme/twentyfifteen/layout/message.gohtml | 0 .../twentyfifteen/layout/pagination.gohtml | 0 .../theme/twentyfifteen/layout/sidebar.gohtml | 0 .../theme/twentyfifteen/layout/svg.gohtml | 0 .../theme/twentyfifteen/posts/detail.gohtml | 0 .../theme/twentyfifteen/posts/index.gohtml | 0 .../theme/twentyfifteen/themesupport.go | 0 .../theme/twentyfifteen/themesupport.json | 0 .../theme/twentyfifteen/twentyfifteen.go | 20 ++++++++-------- .../theme/twentyseventeen/colorscheme.go | 4 ++-- .../theme/twentyseventeen/customheader.go | 2 +- .../theme/twentyseventeen/layout/base.gohtml | 0 .../twentyseventeen/layout/colophon.gohtml | 0 .../twentyseventeen/layout/comment.gohtml | 0 .../theme/twentyseventeen/layout/empty.gohtml | 0 .../twentyseventeen/layout/footer.gohtml | 0 .../twentyseventeen/layout/footersvg.gohtml | 0 .../theme/twentyseventeen/layout/head.gohtml | 0 .../twentyseventeen/layout/message.gohtml | 0 .../twentyseventeen/layout/pagination.gohtml | 0 .../twentyseventeen/layout/sidebar.gohtml | 0 .../theme/twentyseventeen/layout/svg.gohtml | 0 .../theme/twentyseventeen/posts/detail.gohtml | 0 .../theme/twentyseventeen/posts/error.gohtml | 0 .../theme/twentyseventeen/posts/index.gohtml | 0 .../theme/twentyseventeen/script.go | 6 ++--- .../theme/twentyseventeen/themesupport.go | 0 .../theme/twentyseventeen/themesupport.json | 0 .../theme/twentyseventeen/twentyseventeen.go | 24 +++++++++---------- {internal => app}/theme/wp/calclass.go | 8 +++---- {internal => app}/theme/wp/components.go | 4 ++-- .../theme/wp/components/block.go | 6 ++--- .../theme/wp/components/block/block.go | 0 .../theme/wp/components/block/block_test.go | 0 .../theme/wp/components/block/category.go | 16 ++++++------- .../theme/wp/components/widget/archive.go | 10 ++++---- .../theme/wp/components/widget/args.go | 0 .../theme/wp/components/widget/category.go | 12 +++++----- .../theme/wp/components/widget/fn.go | 6 ++--- .../theme/wp/components/widget/meta.go | 8 +++---- .../wp/components/widget/recentcomments.go | 10 ++++---- .../theme/wp/components/widget/recentposts.go | 14 +++++------ .../theme/wp/components/widget/search.go | 10 ++++---- .../theme/wp/components/widgetareadata.go | 8 +++---- {internal => app}/theme/wp/customcss.go | 2 +- {internal => app}/theme/wp/customheader.go | 10 ++++---- {internal => app}/theme/wp/customlogo.go | 6 ++--- {internal => app}/theme/wp/detail.go | 14 +++++------ {internal => app}/theme/wp/fn.go | 0 {internal => app}/theme/wp/index.go | 8 +++---- {internal => app}/theme/wp/indexparams.go | 10 ++++---- {internal => app}/theme/wp/listpostplugins.go | 10 ++++---- {internal => app}/theme/wp/pipe.go | 4 ++-- {internal => app}/theme/wp/siteicon.go | 4 ++-- {internal => app}/theme/wp/stickyposts.go | 10 ++++---- {internal => app}/theme/wp/template.gohtml | 0 {internal => app}/theme/wp/wp.go | 8 +++---- 78 files changed, 164 insertions(+), 163 deletions(-) rename {internal => app}/plugins/comment.go (98%) rename {internal => app}/plugins/digest.go (93%) rename {internal => app}/plugins/gravatar.go (93%) rename {internal => app}/plugins/pagination.go (100%) rename {internal => app}/plugins/wphandle/enlightjs/enlighterjs.go (93%) rename {internal => app}/plugins/wphandle/handle.go (78%) rename {internal => app}/plugins/wphandle/hiddenlogin/hiddenlogin.go (79%) rename {internal => app}/plugins/wphandle/tests/tt.go (84%) rename {internal => app}/plugins/wpposts/posts.go (92%) rename {internal => app}/theme/fs.go (100%) rename {internal => app}/theme/hook.go (79%) rename {internal => app}/theme/templateFuncs.go (89%) rename {internal => app}/theme/theme.go (68%) rename {internal => app}/theme/twentyfifteen/colorscheme.json (100%) rename {internal => app}/theme/twentyfifteen/colorschemecss.go (99%) rename {internal => app}/theme/twentyfifteen/custombackground.go (98%) rename {internal => app}/theme/twentyfifteen/customheader.go (94%) rename {internal => app}/theme/twentyfifteen/layout/base.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/empty.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/footer.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/head.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/message.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/pagination.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/sidebar.gohtml (100%) rename {internal => app}/theme/twentyfifteen/layout/svg.gohtml (100%) rename {internal => app}/theme/twentyfifteen/posts/detail.gohtml (100%) rename {internal => app}/theme/twentyfifteen/posts/index.gohtml (100%) rename {internal => app}/theme/twentyfifteen/themesupport.go (100%) rename {internal => app}/theme/twentyfifteen/themesupport.json (100%) rename {internal => app}/theme/twentyfifteen/twentyfifteen.go (82%) rename {internal => app}/theme/twentyseventeen/colorscheme.go (99%) rename {internal => app}/theme/twentyseventeen/customheader.go (96%) rename {internal => app}/theme/twentyseventeen/layout/base.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/colophon.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/comment.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/empty.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/footer.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/footersvg.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/head.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/message.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/pagination.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/sidebar.gohtml (100%) rename {internal => app}/theme/twentyseventeen/layout/svg.gohtml (100%) rename {internal => app}/theme/twentyseventeen/posts/detail.gohtml (100%) rename {internal => app}/theme/twentyseventeen/posts/error.gohtml (100%) rename {internal => app}/theme/twentyseventeen/posts/index.gohtml (100%) rename {internal => app}/theme/twentyseventeen/script.go (94%) rename {internal => app}/theme/twentyseventeen/themesupport.go (100%) rename {internal => app}/theme/twentyseventeen/themesupport.json (100%) rename {internal => app}/theme/twentyseventeen/twentyseventeen.go (91%) rename {internal => app}/theme/wp/calclass.go (94%) rename {internal => app}/theme/wp/components.go (98%) rename {internal => app}/theme/wp/components/block.go (84%) rename {internal => app}/theme/wp/components/block/block.go (100%) rename {internal => app}/theme/wp/components/block/block_test.go (100%) rename {internal => app}/theme/wp/components/block/category.go (92%) rename {internal => app}/theme/wp/components/widget/archive.go (94%) rename {internal => app}/theme/wp/components/widget/args.go (100%) rename {internal => app}/theme/wp/components/widget/category.go (96%) rename {internal => app}/theme/wp/components/widget/fn.go (78%) rename {internal => app}/theme/wp/components/widget/meta.go (90%) rename {internal => app}/theme/wp/components/widget/recentcomments.go (89%) rename {internal => app}/theme/wp/components/widget/recentposts.go (87%) rename {internal => app}/theme/wp/components/widget/search.go (90%) rename {internal => app}/theme/wp/components/widgetareadata.go (88%) rename {internal => app}/theme/wp/customcss.go (89%) rename {internal => app}/theme/wp/customheader.go (91%) rename {internal => app}/theme/wp/customlogo.go (90%) rename {internal => app}/theme/wp/detail.go (89%) rename {internal => app}/theme/wp/fn.go (100%) rename {internal => app}/theme/wp/index.go (95%) rename {internal => app}/theme/wp/indexparams.go (96%) rename {internal => app}/theme/wp/listpostplugins.go (89%) rename {internal => app}/theme/wp/pipe.go (98%) rename {internal => app}/theme/wp/siteicon.go (92%) rename {internal => app}/theme/wp/stickyposts.go (82%) rename {internal => app}/theme/wp/template.gohtml (100%) rename {internal => app}/theme/wp/wp.go (96%) diff --git a/internal/plugins/comment.go b/app/plugins/comment.go similarity index 98% rename from internal/plugins/comment.go rename to app/plugins/comment.go index e334d5f..3e1ad8b 100644 --- a/internal/plugins/comment.go +++ b/app/plugins/comment.go @@ -1,10 +1,10 @@ package plugins import ( + "github.com/fthvgb1/wp-go/app/pkg/models" + "github.com/fthvgb1/wp-go/app/wpconfig" "github.com/fthvgb1/wp-go/helper/slice" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/pkg/models" - "github.com/fthvgb1/wp-go/internal/wpconfig" "github.com/gin-gonic/gin" "net/url" "strconv" diff --git a/internal/plugins/digest.go b/app/plugins/digest.go similarity index 93% rename from internal/plugins/digest.go rename to app/plugins/digest.go index edce9d0..276c699 100644 --- a/internal/plugins/digest.go +++ b/app/plugins/digest.go @@ -3,11 +3,11 @@ package plugins import ( "context" "fmt" + "github.com/fthvgb1/wp-go/app/cmd/cachemanager" + "github.com/fthvgb1/wp-go/app/pkg/config" + "github.com/fthvgb1/wp-go/app/pkg/models" "github.com/fthvgb1/wp-go/cache" "github.com/fthvgb1/wp-go/helper" - "github.com/fthvgb1/wp-go/internal/cmd/cachemanager" - "github.com/fthvgb1/wp-go/internal/pkg/config" - "github.com/fthvgb1/wp-go/internal/pkg/models" "github.com/fthvgb1/wp-go/plugin/digest" "regexp" "strings" diff --git a/internal/plugins/gravatar.go b/app/plugins/gravatar.go similarity index 93% rename from internal/plugins/gravatar.go rename to app/plugins/gravatar.go index 2335118..01cafa7 100644 --- a/internal/plugins/gravatar.go +++ b/app/plugins/gravatar.go @@ -2,9 +2,9 @@ package plugins import ( "fmt" + "github.com/fthvgb1/wp-go/app/wpconfig" "github.com/fthvgb1/wp-go/helper/number" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/wpconfig" "net/url" "strings" ) diff --git a/internal/plugins/pagination.go b/app/plugins/pagination.go similarity index 100% rename from internal/plugins/pagination.go rename to app/plugins/pagination.go diff --git a/internal/plugins/wphandle/enlightjs/enlighterjs.go b/app/plugins/wphandle/enlightjs/enlighterjs.go similarity index 93% rename from internal/plugins/wphandle/enlightjs/enlighterjs.go rename to app/plugins/wphandle/enlightjs/enlighterjs.go index 5781de7..e456284 100644 --- a/internal/plugins/wphandle/enlightjs/enlighterjs.go +++ b/app/plugins/wphandle/enlightjs/enlighterjs.go @@ -2,12 +2,12 @@ package enlightjs import ( "fmt" + "github.com/fthvgb1/wp-go/app/phphelper" + "github.com/fthvgb1/wp-go/app/pkg/constraints" + "github.com/fthvgb1/wp-go/app/pkg/logs" + "github.com/fthvgb1/wp-go/app/theme/wp" + "github.com/fthvgb1/wp-go/app/wpconfig" "github.com/fthvgb1/wp-go/helper/maps" - "github.com/fthvgb1/wp-go/internal/phphelper" - "github.com/fthvgb1/wp-go/internal/pkg/constraints" - "github.com/fthvgb1/wp-go/internal/pkg/logs" - "github.com/fthvgb1/wp-go/internal/theme/wp" - "github.com/fthvgb1/wp-go/internal/wpconfig" "github.com/goccy/go-json" ) diff --git a/internal/plugins/wphandle/handle.go b/app/plugins/wphandle/handle.go similarity index 78% rename from internal/plugins/wphandle/handle.go rename to app/plugins/wphandle/handle.go index f81523d..dfd8fb6 100644 --- a/internal/plugins/wphandle/handle.go +++ b/app/plugins/wphandle/handle.go @@ -2,12 +2,12 @@ package wphandle import ( "errors" + "github.com/fthvgb1/wp-go/app/pkg/config" + "github.com/fthvgb1/wp-go/app/pkg/logs" + "github.com/fthvgb1/wp-go/app/plugins/wphandle/enlightjs" + "github.com/fthvgb1/wp-go/app/plugins/wphandle/hiddenlogin" + "github.com/fthvgb1/wp-go/app/theme/wp" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/pkg/config" - "github.com/fthvgb1/wp-go/internal/pkg/logs" - "github.com/fthvgb1/wp-go/internal/plugins/wphandle/enlightjs" - "github.com/fthvgb1/wp-go/internal/plugins/wphandle/hiddenlogin" - "github.com/fthvgb1/wp-go/internal/theme/wp" "github.com/fthvgb1/wp-go/safety" "path/filepath" "plugin" @@ -15,8 +15,8 @@ import ( var plugins = func() *safety.Map[string, func(*wp.Handle)] { m := safety.NewMap[string, func(*wp.Handle)]() - m.Store("enlightjs", enlightjs.EnlighterJS) - m.Store("hiddenLogin", hiddenlogin.HiddenLogin) + m.Store("Enlightjs", enlightjs.EnlighterJS) + m.Store("HiddenLogin", hiddenlogin.HiddenLogin) return m }() @@ -27,6 +27,7 @@ func RegisterPlugin(name string, fn func(*wp.Handle)) { func UsePlugins(h *wp.Handle, calls ...string) { calls = append(calls, config.GetConfig().Plugins...) for _, call := range calls { + call = str.FirstUpper(call) if fn, ok := plugins.Load(call); ok { fn(h) } diff --git a/internal/plugins/wphandle/hiddenlogin/hiddenlogin.go b/app/plugins/wphandle/hiddenlogin/hiddenlogin.go similarity index 79% rename from internal/plugins/wphandle/hiddenlogin/hiddenlogin.go rename to app/plugins/wphandle/hiddenlogin/hiddenlogin.go index 3b2a1a5..511c156 100644 --- a/internal/plugins/wphandle/hiddenlogin/hiddenlogin.go +++ b/app/plugins/wphandle/hiddenlogin/hiddenlogin.go @@ -1,9 +1,9 @@ package hiddenlogin import ( + "github.com/fthvgb1/wp-go/app/pkg/constraints/widgets" + "github.com/fthvgb1/wp-go/app/theme/wp" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/pkg/constraints/widgets" - "github.com/fthvgb1/wp-go/internal/theme/wp" ) func HiddenLogin(h *wp.Handle) { diff --git a/internal/plugins/wphandle/tests/tt.go b/app/plugins/wphandle/tests/tt.go similarity index 84% rename from internal/plugins/wphandle/tests/tt.go rename to app/plugins/wphandle/tests/tt.go index 5dad265..49944a6 100644 --- a/internal/plugins/wphandle/tests/tt.go +++ b/app/plugins/wphandle/tests/tt.go @@ -2,8 +2,8 @@ package tests import ( "fmt" - "github.com/fthvgb1/wp-go/internal/pkg/constraints" - "github.com/fthvgb1/wp-go/internal/theme/wp" + "github.com/fthvgb1/wp-go/app/pkg/constraints" + "github.com/fthvgb1/wp-go/app/theme/wp" ) func Tt(h *wp.Handle) { diff --git a/internal/plugins/wpposts/posts.go b/app/plugins/wpposts/posts.go similarity index 92% rename from internal/plugins/wpposts/posts.go rename to app/plugins/wpposts/posts.go index 62d3ed8..f1fe88a 100644 --- a/internal/plugins/wpposts/posts.go +++ b/app/plugins/wpposts/posts.go @@ -2,7 +2,7 @@ package wpposts import ( "fmt" - "github.com/fthvgb1/wp-go/internal/pkg/models" + "github.com/fthvgb1/wp-go/app/pkg/models" ) func PasswordProjectTitle(post *models.Posts) { diff --git a/internal/theme/fs.go b/app/theme/fs.go similarity index 100% rename from internal/theme/fs.go rename to app/theme/fs.go diff --git a/internal/theme/hook.go b/app/theme/hook.go similarity index 79% rename from internal/theme/hook.go rename to app/theme/hook.go index 72d86b3..a10bbfa 100644 --- a/internal/theme/hook.go +++ b/app/theme/hook.go @@ -1,8 +1,8 @@ package theme import ( - "github.com/fthvgb1/wp-go/internal/theme/twentyfifteen" - "github.com/fthvgb1/wp-go/internal/theme/wp" + "github.com/fthvgb1/wp-go/app/theme/twentyfifteen" + "github.com/fthvgb1/wp-go/app/theme/wp" ) var themeMap = map[string]func(*wp.Handle){} diff --git a/internal/theme/templateFuncs.go b/app/theme/templateFuncs.go similarity index 89% rename from internal/theme/templateFuncs.go rename to app/theme/templateFuncs.go index 85c6acd..60b4f1a 100644 --- a/internal/theme/templateFuncs.go +++ b/app/theme/templateFuncs.go @@ -1,8 +1,8 @@ package theme import ( - "github.com/fthvgb1/wp-go/internal/pkg/models" - "github.com/fthvgb1/wp-go/internal/wpconfig" + "github.com/fthvgb1/wp-go/app/pkg/models" + "github.com/fthvgb1/wp-go/app/wpconfig" "html/template" "time" ) diff --git a/internal/theme/theme.go b/app/theme/theme.go similarity index 68% rename from internal/theme/theme.go rename to app/theme/theme.go index d4dce68..8809a3a 100644 --- a/internal/theme/theme.go +++ b/app/theme/theme.go @@ -1,10 +1,10 @@ package theme import ( - "github.com/fthvgb1/wp-go/internal/pkg/config" - "github.com/fthvgb1/wp-go/internal/theme/twentyfifteen" - "github.com/fthvgb1/wp-go/internal/theme/twentyseventeen" - "github.com/fthvgb1/wp-go/internal/wpconfig" + "github.com/fthvgb1/wp-go/app/pkg/config" + "github.com/fthvgb1/wp-go/app/theme/twentyfifteen" + "github.com/fthvgb1/wp-go/app/theme/twentyseventeen" + "github.com/fthvgb1/wp-go/app/wpconfig" ) func InitTheme() { diff --git a/internal/theme/twentyfifteen/colorscheme.json b/app/theme/twentyfifteen/colorscheme.json similarity index 100% rename from internal/theme/twentyfifteen/colorscheme.json rename to app/theme/twentyfifteen/colorscheme.json diff --git a/internal/theme/twentyfifteen/colorschemecss.go b/app/theme/twentyfifteen/colorschemecss.go similarity index 99% rename from internal/theme/twentyfifteen/colorschemecss.go rename to app/theme/twentyfifteen/colorschemecss.go index 4c3e4b8..8be1d8a 100644 --- a/internal/theme/twentyfifteen/colorschemecss.go +++ b/app/theme/twentyfifteen/colorschemecss.go @@ -2,8 +2,8 @@ package twentyfifteen import ( "fmt" + "github.com/fthvgb1/wp-go/app/theme/wp" "github.com/fthvgb1/wp-go/helper/slice" - "github.com/fthvgb1/wp-go/internal/theme/wp" "strconv" "strings" ) diff --git a/internal/theme/twentyfifteen/custombackground.go b/app/theme/twentyfifteen/custombackground.go similarity index 98% rename from internal/theme/twentyfifteen/custombackground.go rename to app/theme/twentyfifteen/custombackground.go index 86e1471..f1b732f 100644 --- a/internal/theme/twentyfifteen/custombackground.go +++ b/app/theme/twentyfifteen/custombackground.go @@ -2,10 +2,10 @@ package twentyfifteen import ( "fmt" + "github.com/fthvgb1/wp-go/app/theme/wp" "github.com/fthvgb1/wp-go/helper" "github.com/fthvgb1/wp-go/helper/maps" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/theme/wp" ) var postx = map[string]string{ diff --git a/internal/theme/twentyfifteen/customheader.go b/app/theme/twentyfifteen/customheader.go similarity index 94% rename from internal/theme/twentyfifteen/customheader.go rename to app/theme/twentyfifteen/customheader.go index 2894791..35169b5 100644 --- a/internal/theme/twentyfifteen/customheader.go +++ b/app/theme/twentyfifteen/customheader.go @@ -1,10 +1,10 @@ package twentyfifteen import ( + "github.com/fthvgb1/wp-go/app/cmd/reload" + "github.com/fthvgb1/wp-go/app/pkg/constraints" + "github.com/fthvgb1/wp-go/app/theme/wp" str "github.com/fthvgb1/wp-go/helper/strings" - "github.com/fthvgb1/wp-go/internal/cmd/reload" - "github.com/fthvgb1/wp-go/internal/pkg/constraints" - "github.com/fthvgb1/wp-go/internal/theme/wp" ) var style = `