diff --git a/internal/actions/themehook.go b/internal/actions/themehook.go
index cbcbcd5..fcf2bb6 100644
--- a/internal/actions/themehook.go
+++ b/internal/actions/themehook.go
@@ -2,16 +2,16 @@ package actions
import (
"github.com/fthvgb1/wp-go/internal/theme"
- "github.com/fthvgb1/wp-go/internal/theme/common"
+ "github.com/fthvgb1/wp-go/internal/theme/wp"
"github.com/gin-gonic/gin"
)
func ThemeHook(scene int) func(*gin.Context) {
return func(ctx *gin.Context) {
t := theme.GetTemplateName()
- h := common.NewHandle(ctx, scene, t)
- h.Index = common.NewIndexHandle(h)
- h.Detail = common.NewDetailHandle(h)
+ h := wp.NewHandle(ctx, scene, t)
+ h.Index = wp.NewIndexHandle(h)
+ h.Detail = wp.NewDetailHandle(h)
theme.Hook(t, h)
}
}
diff --git a/internal/theme/fs.go b/internal/theme/fs.go
index 55ba6bb..5eaa264 100644
--- a/internal/theme/fs.go
+++ b/internal/theme/fs.go
@@ -33,7 +33,7 @@ func commonTemplate(t *multipTemplate.MultipleFsTemplate) {
for _, main := range m {
file := filepath.Base(main)
dir := strings.Split(main, "/")[0]
- templ := template.Must(template.New(file).Funcs(t.FuncMap).ParseFS(t.Fs, main, filepath.Join(dir, "layout/*.gohtml"), "common/template.gohtml"))
+ templ := template.Must(template.New(file).Funcs(t.FuncMap).ParseFS(t.Fs, main, filepath.Join(dir, "layout/*.gohtml"), "wp/template.gohtml"))
t.SetTemplate(main, templ)
}
}
diff --git a/internal/theme/hook.go b/internal/theme/hook.go
index 4819f7e..72d86b3 100644
--- a/internal/theme/hook.go
+++ b/internal/theme/hook.go
@@ -1,20 +1,20 @@
package theme
import (
- "github.com/fthvgb1/wp-go/internal/theme/common"
"github.com/fthvgb1/wp-go/internal/theme/twentyfifteen"
+ "github.com/fthvgb1/wp-go/internal/theme/wp"
)
-var themeMap = map[string]func(*common.Handle){}
+var themeMap = map[string]func(*wp.Handle){}
-func addThemeHookFunc(name string, fn func(handle *common.Handle)) {
+func addThemeHookFunc(name string, fn func(handle *wp.Handle)) {
if _, ok := themeMap[name]; ok {
panic("exists same name theme")
}
themeMap[name] = fn
}
-func Hook(themeName string, handle *common.Handle) {
+func Hook(themeName string, handle *wp.Handle) {
fn, ok := themeMap[themeName]
if ok && fn != nil {
fn(handle)
diff --git a/internal/theme/twentyfifteen/colorschemecss.go b/internal/theme/twentyfifteen/colorschemecss.go
index 6fc7c95..f3bc12f 100644
--- a/internal/theme/twentyfifteen/colorschemecss.go
+++ b/internal/theme/twentyfifteen/colorschemecss.go
@@ -3,12 +3,12 @@ package twentyfifteen
import (
"fmt"
"github.com/fthvgb1/wp-go/helper/slice"
- "github.com/fthvgb1/wp-go/internal/theme/common"
+ "github.com/fthvgb1/wp-go/internal/theme/wp"
"strconv"
"strings"
)
-func colorSchemeCss(h *common.Handle) string {
+func colorSchemeCss(h *wp.Handle) string {
s := slice.Filter([]string{calColorSchemeCss(h), calSidebarTextColorCss(h), calHeaderBackgroundColorCss(h)}, func(s string) bool {
return s != ""
})
@@ -17,7 +17,7 @@ func colorSchemeCss(h *common.Handle) string {
}
return fmt.Sprintf(``, "twentyfifteen-style", "", strings.Join(s, "\n"))
}
-func calColorSchemeCss(h *common.Handle) (r string) {
+func calColorSchemeCss(h *wp.Handle) (r string) {
color := getColorScheme(h)
if "default" == h.CommonThemeMods().ColorScheme || len(color) < 1 {
return
@@ -46,7 +46,7 @@ func calColorSchemeCss(h *common.Handle) (r string) {
return
}
-func calSidebarTextColorCss(h *common.Handle) (r string) {
+func calSidebarTextColorCss(h *wp.Handle) (r string) {
colors := getColorScheme(h)
themeMods := h.CommonThemeMods()
if themeMods.SidebarTextcolor == "" || themeMods.SidebarTextcolor == colors[4] {
@@ -61,7 +61,7 @@ func calSidebarTextColorCss(h *common.Handle) (r string) {
return
}
-func calHeaderBackgroundColorCss(h *common.Handle) (r string) {
+func calHeaderBackgroundColorCss(h *wp.Handle) (r string) {
colors := getColorScheme(h)
themeMods := h.CommonThemeMods()
if themeMods.HeaderBackgroundColor == "" || themeMods.HeaderBackgroundColor == colors[1] {
@@ -71,7 +71,7 @@ func calHeaderBackgroundColorCss(h *common.Handle) (r string) {
return
}
-func getColorScheme(h *common.Handle) (r []string) {
+func getColorScheme(h *wp.Handle) (r []string) {
x, ok := colorscheme[h.CommonThemeMods().ColorScheme]
if ok {
r = x.Colors
diff --git a/internal/theme/twentyfifteen/custombackground.go b/internal/theme/twentyfifteen/custombackground.go
index fdba529..463c987 100644
--- a/internal/theme/twentyfifteen/custombackground.go
+++ b/internal/theme/twentyfifteen/custombackground.go
@@ -5,7 +5,7 @@ import (
"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/common"
+ "github.com/fthvgb1/wp-go/internal/theme/wp"
)
var postx = map[string]string{
@@ -30,7 +30,7 @@ var repeat = map[string]string{
"no-repeat": "no-repeat",
}
-func CalCustomBackGround(h *common.Handle) (r string) {
+func CalCustomBackGround(h *wp.Handle) (r string) {
themeMods := h.CommonThemeMods()
if themeMods.BackgroundImage == "" && themeMods.BackgroundColor == themesupport.CustomBackground.DefaultColor {
return
diff --git a/internal/theme/twentyfifteen/customheader.go b/internal/theme/twentyfifteen/customheader.go
index c238df9..338cd50 100644
--- a/internal/theme/twentyfifteen/customheader.go
+++ b/internal/theme/twentyfifteen/customheader.go
@@ -4,7 +4,7 @@ import (
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/common"
+ "github.com/fthvgb1/wp-go/internal/theme/wp"
)
var style = `