diff --git a/.gitignore b/.gitignore index b94deca..600cf56 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ wp-go.iml config.yaml err.log -./plugins/ \ No newline at end of file +/plugins/ diff --git a/app/plugins/wphandle/apply/apply.go b/app/plugins/wphandle/apply/apply.go new file mode 100644 index 0000000..8efc18e --- /dev/null +++ b/app/plugins/wphandle/apply/apply.go @@ -0,0 +1,11 @@ +package apply + +var fn any + +func SetFn(f any) { + fn = f +} + +func UsePlugins() any { + return fn +} diff --git a/app/plugins/wphandle/handle.go b/app/plugins/wphandle/handle.go index 0dfd421..fe63baa 100644 --- a/app/plugins/wphandle/handle.go +++ b/app/plugins/wphandle/handle.go @@ -4,6 +4,7 @@ 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/apply" "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" @@ -65,5 +66,7 @@ func LoadPlugins() { } RegisterPlugin(name, plu) } - + apply.SetFn(func(h *wp.Handle) { + UsePlugins(h) + }) } diff --git a/app/theme/hook.go b/app/theme/hook.go index a113aea..7f1b720 100644 --- a/app/theme/hook.go +++ b/app/theme/hook.go @@ -1,9 +1,9 @@ package theme import ( + "github.com/fthvgb1/wp-go/app/theme/twentyfifteen" "github.com/fthvgb1/wp-go/app/theme/wp" "github.com/fthvgb1/wp-go/safety" - "net/http" ) var themeMap = safety.NewMap[string, func(*wp.Handle)]() @@ -21,5 +21,5 @@ func Hook(themeName string, h *wp.Handle) { fn(h) return } - h.C.String(http.StatusNotFound, "404") + twentyfifteen.Hook(h) } diff --git a/app/theme/theme.go b/app/theme/theme.go index 5a9b014..1a11c44 100644 --- a/app/theme/theme.go +++ b/app/theme/theme.go @@ -9,9 +9,7 @@ import ( func InitTheme() { AddThemeHookFunc(twentyfifteen.ThemeName, twentyfifteen.Hook) - twentyfifteen.Init(TemplateFs) AddThemeHookFunc(twentyseventeen.ThemeName, twentyseventeen.Hook) - twentyseventeen.Init(TemplateFs) } func GetCurrentTemplateName() string { diff --git a/app/theme/twentyfifteen/colorscheme.json b/app/theme/twentyfifteen/colorscheme.json deleted file mode 100644 index 2720d14..0000000 --- a/app/theme/twentyfifteen/colorscheme.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "default": { - "label": "Default", - "colors": [ - "#f1f1f1", - "#ffffff", - "#ffffff", - "#333333", - "#333333", - "#f7f7f7" - ] - }, - "dark": { - "label": "Dark", - "colors": [ - "#111111", - "#202020", - "#202020", - "#bebebe", - "#bebebe", - "#1b1b1b" - ] - }, - "yellow": { - "label": "Yellow", - "colors": [ - "#f4ca16", - "#ffdf00", - "#ffffff", - "#111111", - "#111111", - "#f1f1f1" - ] - }, - "pink": { - "label": "Pink", - "colors": [ - "#ffe5d1", - "#e53b51", - "#ffffff", - "#352712", - "#ffffff", - "#f1f1f1" - ] - }, - "purple": { - "label": "Purple", - "colors": [ - "#674970", - "#2e2256", - "#ffffff", - "#2e2256", - "#ffffff", - "#f1f1f1" - ] - }, - "blue": { - "label": "Blue", - "colors": [ - "#e9f2f9", - "#55c3dc", - "#ffffff", - "#22313f", - "#ffffff", - "#f1f1f1" - ] - } -} diff --git a/app/theme/twentyfifteen/themesupport.go b/app/theme/twentyfifteen/themesupport.go index b3a488a..d731874 100644 --- a/app/theme/twentyfifteen/themesupport.go +++ b/app/theme/twentyfifteen/themesupport.go @@ -30,5 +30,200 @@ type EditorGradientPresets struct { Gradient string `json:"gradient"` } -var themesupport themeSupport -var colorscheme map[string]ColorScheme +var themesupport = themeSupport{ + CustomBackground: customBackground{ + DefaultImage: "", + DefaultPreset: "default", + DefaultPositionX: "left", + DefaultPositionY: "top", + DefaultSize: "auto", + DefaultRepeat: "repeat", + DefaultAttachment: "fixed", + DefaultColor: "f1f1f1", + WpHeadCallback: "_custom_background_cb", + AdminHeadCallback: "", + AdminPreviewCallback: "", + }, + EditorColorPalette: []EditorColorPalette{ + { + Name: "暗灰色", + Slug: "dark-gray", + Color: "#111", + }, + { + Name: "亮灰色", + Slug: "light-gray", + Color: "#f1f1f1", + }, + { + Name: "白色", + Slug: "white", + Color: "#fff", + }, + { + Name: "黄色", + Slug: "yellow", + Color: "#f4ca16", + }, + { + Name: "暗棕色", + Slug: "dark-brown", + Color: "#352712", + }, + { + Name: "粉色", + Slug: "medium-pink", + Color: "#e53b51", + }, + { + Name: "浅粉色", + Slug: "light-pink", + Color: "#ffe5d1", + }, + { + Name: "暗紫色", + Slug: "dark-purple", + Color: "#2e2256", + }, + { + Name: "紫色", + Slug: "purple", + Color: "#674970", + }, + { + Name: "蓝灰色", + Slug: "blue-gray", + Color: "#22313f", + }, + { + Name: "亮蓝色", + Slug: "bright-blue", + Color: "#55c3dc", + }, + { + Name: "浅蓝色", + Slug: "light-blue", + Color: "#e9f2f9", + }, + }, + EditorGradientPresets: []EditorGradientPresets{ + { + Name: "Dark Gray Gradient", + Slug: "dark-gray-gradient-gradient", + Gradient: "linear-gradient(90deg, rgba(17,17,17,1) 0%, rgba(42,42,42,1) 100%)", + }, + { + Name: "Light Gray Gradient", + Slug: "light-gray-gradient", + Gradient: "linear-gradient(90deg, rgba(241,241,241,1) 0%, rgba(215,215,215,1) 100%)", + }, + { + Name: "White Gradient", + Slug: "white-gradient", + Gradient: "linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 100%)", + }, + { + Name: "Yellow Gradient", + Slug: "yellow-gradient", + Gradient: "linear-gradient(90deg, rgba(244,202,22,1) 0%, rgba(205,168,10,1) 100%)", + }, + { + Name: "Dark Brown Gradient", + Slug: "dark-brown-gradient", + Gradient: "linear-gradient(90deg, rgba(53,39,18,1) 0%, rgba(91,67,31,1) 100%)", + }, + { + Name: "Medium Pink Gradient", + Slug: "medium-pink-gradient", + Gradient: "linear-gradient(90deg, rgba(229,59,81,1) 0%, rgba(209,28,51,1) 100%)", + }, + { + Name: "Light Pink Gradient", + Slug: "light-pink-gradient", + Gradient: "linear-gradient(90deg, rgba(255,229,209,1) 0%, rgba(255,200,158,1) 100%)", + }, + { + Name: "Dark Purple Gradient", + Slug: "dark-purple-gradient", + Gradient: "linear-gradient(90deg, rgba(46,34,86,1) 0%, rgba(66,48,123,1) 100%)", + }, + { + Name: "Purple Gradient", + Slug: "purple-gradient", + Gradient: "linear-gradient(90deg, rgba(103,73,112,1) 0%, rgba(131,93,143,1) 100%)", + }, + { + Name: "Blue Gray Gradient", + Slug: "blue-gray-gradient", + Gradient: "linear-gradient(90deg, rgba(34,49,63,1) 0%, rgba(52,75,96,1) 100%)", + }, + { + Name: "Bright Blue Gradient", + Slug: "bright-blue-gradient", + Gradient: "linear-gradient(90deg, rgba(85,195,220,1) 0%, rgba(43,180,211,1) 100%)", + }, + { + Name: "Light Blue Gradient", + Slug: "light-blue-gradient", + Gradient: "linear-gradient(90deg, rgba(233,242,249,1) 0%, rgba(193,218,238,1) 100%)", + }, + }, +} +var colorscheme = map[string]ColorScheme{ + "default": { + Label: "Default", + Colors: []string{ + "#f1f1f1", + "#ffffff", + "#ffffff", + "#333333", + "#333333", + "#f7f7f7", + }, + }, + "dark": { + Label: "Dark", + Colors: []string{ + "#111111", + "#202020", + "#202020", + "#bebebe", + "#bebebe", + "#1b1b1b", + }, + }, + + "pink": { + Label: "Pink", + Colors: []string{ + "#ffe5d1", + "#e53b51", + "#ffffff", + "#352712", + "#ffffff", + "#f1f1f1", + }, + }, + "purple": { + Label: "Purple", + Colors: []string{ + "#674970", + "#2e2256", + "#ffffff", + "#2e2256", + "#ffffff", + "#f1f1f1", + }, + }, + "blue": { + Label: "Blue", + Colors: []string{ + "#e9f2f9", + "#55c3dc", + "#ffffff", + "#22313f", + "#ffffff", + "#f1f1f1", + }, + }, +} diff --git a/app/theme/twentyfifteen/themesupport.json b/app/theme/twentyfifteen/themesupport.json deleted file mode 100644 index dd285bb..0000000 --- a/app/theme/twentyfifteen/themesupport.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "core-block-patterns": true, - "widgets-block-editor": true, - "automatic-feed-links": true, - "title-tag": true, - "post-thumbnails": true, - "menus": true, - "html5": [ - "search-form", - "comment-form", - "comment-list", - "gallery", - "caption", - "script", - "style", - "navigation-widgets" - ], - "post-formats": [ - "aside", - "image", - "video", - "quote", - "link", - "gallery", - "status", - "audio", - "chat" - ], - "custom-logo": { - "width": 248, - "height": 248, - "flex-width": false, - "flex-height": true, - "header-text": "", - "unlink-homepage-logo": false - }, - "custom-background": { - "default-image": "", - "default-preset": "default", - "default-position-x": "left", - "default-position-y": "top", - "default-size": "auto", - "default-repeat": "repeat", - "default-attachment": "fixed", - "default-color": "f1f1f1", - "wp-head-callback": "_custom_background_cb", - "admin-head-callback": "", - "admin-preview-callback": "" - }, - "editor-style": true, - "editor-styles": true, - "wp-block-styles": true, - "responsive-embeds": true, - "editor-color-palette": [ - { - "name": "暗灰色", - "slug": "dark-gray", - "color": "#111" - }, - { - "name": "亮灰色", - "slug": "light-gray", - "color": "#f1f1f1" - }, - { - "name": "白色", - "slug": "white", - "color": "#fff" - }, - { - "name": "黄色", - "slug": "yellow", - "color": "#f4ca16" - }, - { - "name": "暗棕色", - "slug": "dark-brown", - "color": "#352712" - }, - { - "name": "粉色", - "slug": "medium-pink", - "color": "#e53b51" - }, - { - "name": "浅粉色", - "slug": "light-pink", - "color": "#ffe5d1" - }, - { - "name": "暗紫色", - "slug": "dark-purple", - "color": "#2e2256" - }, - { - "name": "紫色", - "slug": "purple", - "color": "#674970" - }, - { - "name": "蓝灰色", - "slug": "blue-gray", - "color": "#22313f" - }, - { - "name": "亮蓝色", - "slug": "bright-blue", - "color": "#55c3dc" - }, - { - "name": "浅蓝色", - "slug": "light-blue", - "color": "#e9f2f9" - } - ], - "editor-gradient-presets": [ - { - "name": "Dark Gray Gradient", - "slug": "dark-gray-gradient-gradient", - "gradient": "linear-gradient(90deg, rgba(17,17,17,1) 0%, rgba(42,42,42,1) 100%)" - }, - { - "name": "Light Gray Gradient", - "slug": "light-gray-gradient", - "gradient": "linear-gradient(90deg, rgba(241,241,241,1) 0%, rgba(215,215,215,1) 100%)" - }, - { - "name": "White Gradient", - "slug": "white-gradient", - "gradient": "linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(230,230,230,1) 100%)" - }, - { - "name": "Yellow Gradient", - "slug": "yellow-gradient", - "gradient": "linear-gradient(90deg, rgba(244,202,22,1) 0%, rgba(205,168,10,1) 100%)" - }, - { - "name": "Dark Brown Gradient", - "slug": "dark-brown-gradient", - "gradient": "linear-gradient(90deg, rgba(53,39,18,1) 0%, rgba(91,67,31,1) 100%)" - }, - { - "name": "Medium Pink Gradient", - "slug": "medium-pink-gradient", - "gradient": "linear-gradient(90deg, rgba(229,59,81,1) 0%, rgba(209,28,51,1) 100%)" - }, - { - "name": "Light Pink Gradient", - "slug": "light-pink-gradient", - "gradient": "linear-gradient(90deg, rgba(255,229,209,1) 0%, rgba(255,200,158,1) 100%)" - }, - { - "name": "Dark Purple Gradient", - "slug": "dark-purple-gradient", - "gradient": "linear-gradient(90deg, rgba(46,34,86,1) 0%, rgba(66,48,123,1) 100%)" - }, - { - "name": "Purple Gradient", - "slug": "purple-gradient", - "gradient": "linear-gradient(90deg, rgba(103,73,112,1) 0%, rgba(131,93,143,1) 100%)" - }, - { - "name": "Blue Gray Gradient", - "slug": "blue-gray-gradient", - "gradient": "linear-gradient(90deg, rgba(34,49,63,1) 0%, rgba(52,75,96,1) 100%)" - }, - { - "name": "Bright Blue Gradient", - "slug": "bright-blue-gradient", - "gradient": "linear-gradient(90deg, rgba(85,195,220,1) 0%, rgba(43,180,211,1) 100%)" - }, - { - "name": "Light Blue Gradient", - "slug": "light-blue-gradient", - "gradient": "linear-gradient(90deg, rgba(233,242,249,1) 0%, rgba(193,218,238,1) 100%)" - } - ], - "customize-selective-refresh-widgets": true, - "custom-header": { - "default-image": "", - "random-default": false, - "width": 954, - "height": 1300, - "flex-height": false, - "flex-width": false, - "default-text-color": "333333", - "header-text": true, - "uploads": true, - "wp-head-callback": "twentyfifteen_header_style", - "admin-head-callback": "", - "admin-preview-callback": "", - "video": false, - "video-active-callback": "is_front_page" - }, - "widgets": true -} diff --git a/app/theme/twentyfifteen/twentyfifteen.go b/app/theme/twentyfifteen/twentyfifteen.go index 4199a39..bf28c0a 100644 --- a/app/theme/twentyfifteen/twentyfifteen.go +++ b/app/theme/twentyfifteen/twentyfifteen.go @@ -1,14 +1,10 @@ package twentyfifteen import ( - "embed" - "encoding/json" "github.com/fthvgb1/wp-go/app/pkg/config" "github.com/fthvgb1/wp-go/app/pkg/constraints" "github.com/fthvgb1/wp-go/app/pkg/constraints/widgets" - "github.com/fthvgb1/wp-go/app/pkg/logs" "github.com/fthvgb1/wp-go/app/plugins" - "github.com/fthvgb1/wp-go/app/plugins/wphandle" "github.com/fthvgb1/wp-go/app/theme/wp" "github.com/fthvgb1/wp-go/app/theme/wp/components" "github.com/fthvgb1/wp-go/app/theme/wp/components/widget" @@ -18,35 +14,11 @@ import ( const ThemeName = "twentyfifteen" -func Init(fs embed.FS) { - b, err := fs.ReadFile("twentyfifteen/themesupport.json") - if err != nil { - logs.Error(err, "读取themesupport.json失败") - return - } - err = json.Unmarshal(b, &themesupport) - if err != nil { - logs.Error(err, "解析themesupport失败") - return - } - bytes, err := fs.ReadFile("twentyfifteen/colorscheme.json") - if err != nil { - logs.Error(err, "读取colorscheme.json失败") - return - } - err = json.Unmarshal(bytes, &colorscheme) - if err != nil { - logs.Error(err, "解析colorscheme失败") - return - } -} - func Hook(h *wp.Handle) { wp.Run(h, configs) } func configs(h *wp.Handle) { - wphandle.UsePlugins(h) conf := config.GetConfig() h.PushComponentFilterFn(widgets.Search, func(h *wp.Handle, s string, args ...any) string { return strings.ReplaceAll(s, `class="search-submit"`, `class="search-submit screen-reader-text"`) diff --git a/app/theme/twentyseventeen/themesupport.go b/app/theme/twentyseventeen/themesupport.go index 35cece2..50aab9b 100644 --- a/app/theme/twentyseventeen/themesupport.go +++ b/app/theme/twentyseventeen/themesupport.go @@ -22,13 +22,7 @@ type Blog struct { type HomepageSection struct { Thumbnail string `json:"thumbnail"` } -type Posts struct { - Num0 string `json:"0"` - About About `json:"about"` - Contact Contact `json:"contact"` - Blog Blog `json:"blog"` - HomepageSection HomepageSection `json:"homepage-section"` -} + type ImageEspresso struct { PostTitle string `json:"post_title"` File string `json:"file"` @@ -46,6 +40,11 @@ type Attachments struct { ImageSandwich ImageSandwich `json:"image-sandwich"` ImageCoffee ImageCoffee `json:"image-coffee"` } + +type Image struct { + PostTitle string `json:"post_title"` + File string `json:"file"` +} type Options struct { ShowOnFront string `json:"show_on_front"` PageOnFront string `json:"page_on_front"` @@ -57,25 +56,94 @@ type ThemeMods struct { Panel3 string `json:"panel_3"` Panel4 string `json:"panel_4"` } -type Top struct { +type Menus struct { Name string `json:"name"` Items []string `json:"items"` } -type Social struct { - Name string `json:"name"` - Items []string `json:"items"` -} -type NavMenus struct { - Top Top `json:"top"` - Social Social `json:"social"` -} -type StarterContent struct { - Widgets Widgets `json:"widgets"` - Posts Posts `json:"posts"` - Attachments Attachments `json:"attachments"` - Options Options `json:"options"` - ThemeMods ThemeMods `json:"theme_mods"` - NavMenus NavMenus `json:"nav_menus"` -} -var themesupport themeSupport +type NavMenus struct { + Top Menus `json:"top"` + Social Menus `json:"social"` +} +type StarterContent struct { + Widgets Widgets `json:"widgets"` + Posts map[string]map[string]string `json:"posts"` + Attachments map[string]Image `json:"attachments"` + Options Options `json:"options"` + ThemeMods ThemeMods `json:"theme_mods"` + NavMenus NavMenus `json:"nav_menus"` +} + +var themesupport = themeSupport{ + CustomLineHeight: true, + StarterContent: StarterContent{ + Widgets: Widgets{ + Sidebar1: []string{"text_business_info", "search", "text_about"}, + Sidebar2: []string{"text_business_info"}, + Sidebar3: []string{"text_about", "search"}, + }, + Posts: map[string]map[string]string{ + "0": { + "home": "home", + }, + "about": { + "thumbnail": "{{image-sandwich}}", + }, + "contact": { + "thumbnail": "{{image-espresso}}", + }, + "blog": { + "thumbnail": "{{image-coffee}}", + }, + "homepage-section": { + "thumbnail": "{{image-espresso}}", + }, + }, + Attachments: map[string]Image{ + "image-espresso": { + PostTitle: "浓缩咖啡", + File: "assets/images/espresso.jpg", + }, + "image-sandwich": { + PostTitle: "三明治", + File: "assets/images/sandwich.jpg", + }, + "image-coffee": { + PostTitle: "咖啡", + File: "assets/images/coffee.jpg", + }, + }, + Options: Options{ + ShowOnFront: "page", + PageOnFront: "{{home}}", + PageForPosts: "{{blog}}", + }, + ThemeMods: ThemeMods{ + Panel1: "{{homepage-section}}", + Panel2: "{{about}}", + Panel3: "{{blog}}", + Panel4: "{{contact}}", + }, + NavMenus: NavMenus{ + Top: Menus{ + Name: "顶部菜单", + Items: []string{ + "link_home", + "page_about", + "page_blog", + "page_contact", + }, + }, + Social: Menus{ + Name: "社交网络链接菜单", + Items: []string{ + "link_yelp", + "link_facebook", + "link_twitter", + "link_instagram", + "link_email", + }, + }, + }, + }, +} diff --git a/app/theme/twentyseventeen/themesupport.json b/app/theme/twentyseventeen/themesupport.json deleted file mode 100644 index 5f59d99..0000000 --- a/app/theme/twentyseventeen/themesupport.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "core-block-patterns": true, - "widgets-block-editor": true, - "automatic-feed-links": true, - "title-tag": true, - "custom-line-height": true, - "post-thumbnails": true, - "menus": true, - "html5": [ - "comment-form", - "comment-list", - "gallery", - "caption", - "script", - "style", - "navigation-widgets" - ], - "post-formats": [ - "aside", - "image", - "video", - "quote", - "link", - "gallery", - "audio" - ], - "custom-logo": { - "width": 250, - "height": 250, - "flex-width": true, - "flex-height": false, - "header-text": "", - "unlink-homepage-logo": false - }, - "customize-selective-refresh-widgets": true, - "editor-style": true, - "editor-styles": true, - "wp-block-styles": true, - "responsive-embeds": true, - "starter-content": { - "widgets": { - "sidebar-1": [ - "text_business_info", - "search", - "text_about" - ], - "sidebar-2": [ - "text_business_info" - ], - "sidebar-3": [ - "text_about", - "search" - ] - }, - "posts": { - "0": "home", - "about": { - "thumbnail": "{{image-sandwich}}" - }, - "contact": { - "thumbnail": "{{image-espresso}}" - }, - "blog": { - "thumbnail": "{{image-coffee}}" - }, - "homepage-section": { - "thumbnail": "{{image-espresso}}" - } - }, - "attachments": { - "image-espresso": { - "post_title": "浓缩咖啡", - "file": "assets\/images\/espresso.jpg" - }, - "image-sandwich": { - "post_title": "三明治", - "file": "assets\/images\/sandwich.jpg" - }, - "image-coffee": { - "post_title": "咖啡", - "file": "assets\/images\/coffee.jpg" - } - }, - "options": { - "show_on_front": "page", - "page_on_front": "{{home}}", - "page_for_posts": "{{blog}}" - }, - "theme_mods": { - "panel_1": "{{homepage-section}}", - "panel_2": "{{about}}", - "panel_3": "{{blog}}", - "panel_4": "{{contact}}" - }, - "nav_menus": { - "top": { - "name": "顶部菜单", - "items": [ - "link_home", - "page_about", - "page_blog", - "page_contact" - ] - }, - "social": { - "name": "社交网络链接菜单", - "items": [ - "link_yelp", - "link_facebook", - "link_twitter", - "link_instagram", - "link_email" - ] - } - } - }, - "custom-header": { - "default-image": "http:\/\/wp.test\/wp-content\/themes\/twentyseventeen\/assets\/images\/header.jpg", - "random-default": false, - "width": 2000, - "height": 1200, - "flex-height": true, - "flex-width": false, - "default-text-color": "", - "header-text": true, - "uploads": true, - "wp-head-callback": "twentyseventeen_header_style", - "admin-head-callback": "", - "admin-preview-callback": "", - "video": true, - "video-active-callback": "is_front_page" - }, - "widgets": true -} \ No newline at end of file diff --git a/app/theme/twentyseventeen/twentyseventeen.go b/app/theme/twentyseventeen/twentyseventeen.go index f7b7276..48f77be 100644 --- a/app/theme/twentyseventeen/twentyseventeen.go +++ b/app/theme/twentyseventeen/twentyseventeen.go @@ -1,8 +1,6 @@ package twentyseventeen import ( - "embed" - "encoding/json" "fmt" "github.com/fthvgb1/wp-go/app/cmd/reload" "github.com/fthvgb1/wp-go/app/pkg/config" @@ -11,7 +9,6 @@ import ( "github.com/fthvgb1/wp-go/app/pkg/logs" "github.com/fthvgb1/wp-go/app/pkg/models" "github.com/fthvgb1/wp-go/app/plugins" - "github.com/fthvgb1/wp-go/app/plugins/wphandle" "github.com/fthvgb1/wp-go/app/theme/wp" "github.com/fthvgb1/wp-go/app/theme/wp/components" "github.com/fthvgb1/wp-go/app/theme/wp/components/widget" @@ -24,14 +21,6 @@ import ( const ThemeName = "twentyseventeen" -func Init(fs embed.FS) { - b, err := fs.ReadFile(str.Join(ThemeName, "/themesupport.json")) - if err != nil { - return - } - err = json.Unmarshal(b, &themesupport) -} - var paginate = func() plugins.PageEle { p := plugins.TwentyFifteenPagination() p.PrevEle = `