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 = `