完善twenty seventeen
This commit is contained in:
parent
cd5a9eadd7
commit
7d95109e78
|
@ -3,6 +3,7 @@ package common
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/fthvgb1/wp-go/helper/maps"
|
"github.com/fthvgb1/wp-go/helper/maps"
|
||||||
|
str "github.com/fthvgb1/wp-go/helper/strings"
|
||||||
"github.com/fthvgb1/wp-go/internal/pkg/cache"
|
"github.com/fthvgb1/wp-go/internal/pkg/cache"
|
||||||
"github.com/fthvgb1/wp-go/internal/wpconfig"
|
"github.com/fthvgb1/wp-go/internal/wpconfig"
|
||||||
"github.com/fthvgb1/wp-go/safety"
|
"github.com/fthvgb1/wp-go/safety"
|
||||||
|
@ -16,9 +17,12 @@ func (h *Handle) CalCustomLogo() (r string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
id := uint64(mods.CustomLogo)
|
id := uint64(mods.CustomLogo)
|
||||||
|
if id < 1 {
|
||||||
|
id = str.ToInteger[uint64](wpconfig.Options.Value("site_logo"), 0)
|
||||||
if id < 1 {
|
if id < 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
logo, err := cache.GetPostById(h.C, id)
|
logo, err := cache.GetPostById(h.C, id)
|
||||||
if err != nil || logo.AttachmentMetadata.File == "" {
|
if err != nil || logo.AttachmentMetadata.File == "" {
|
||||||
return
|
return
|
||||||
|
|
21
internal/theme/common/template.gohtml
Normal file
21
internal/theme/common/template.gohtml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{{define "common/head"}}
|
||||||
|
{{if .customBackground}}
|
||||||
|
{{.customBackground|unescaped}}
|
||||||
|
{{end}}
|
||||||
|
{{if .customHeader}}
|
||||||
|
{{.customHeader|unescaped}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if .siteIcon}}
|
||||||
|
{{.siteIcon|unescaped}}
|
||||||
|
{{end}}
|
||||||
|
{{if .customCss}}
|
||||||
|
{{.customCss|unescaped}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{define "common/customLogo"}}
|
||||||
|
{{if .customLogo}}
|
||||||
|
{{.customLogo|unescaped}}
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
|
@ -33,7 +33,7 @@ func commonTemplate(t *multipTemplate.MultipleFsTemplate) {
|
||||||
for _, main := range m {
|
for _, main := range m {
|
||||||
file := filepath.Base(main)
|
file := filepath.Base(main)
|
||||||
dir := strings.Split(main, "/")[0]
|
dir := strings.Split(main, "/")[0]
|
||||||
templ := template.Must(template.New(file).Funcs(t.FuncMap).ParseFS(t.Fs, main, filepath.Join(dir, "layout/*.gohtml")))
|
templ := template.Must(template.New(file).Funcs(t.FuncMap).ParseFS(t.Fs, main, filepath.Join(dir, "layout/*.gohtml"), "common/template.gohtml"))
|
||||||
t.SetTemplate(main, templ)
|
t.SetTemplate(main, templ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,7 @@
|
||||||
<div id="sidebar" class="sidebar" style="position: relative; ">
|
<div id="sidebar" class="sidebar" style="position: relative; ">
|
||||||
<header id="masthead" class="site-header">
|
<header id="masthead" class="site-header">
|
||||||
<div class="site-branding">
|
<div class="site-branding">
|
||||||
{{if .customLogo}}
|
{{template "common/customLogo" .}}
|
||||||
{{.customLogo|unescaped}}
|
|
||||||
{{end}}
|
|
||||||
<h1 class="site-title">
|
<h1 class="site-title">
|
||||||
<a href="/" rel="home">{{ "blogname"| getOption }}</a>
|
<a href="/" rel="home">{{ "blogname"| getOption }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
@ -58,18 +58,6 @@
|
||||||
<meta name="generator" content="WordPress 6.0.2" />
|
<meta name="generator" content="WordPress 6.0.2" />
|
||||||
<style>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
|
<style>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
|
||||||
|
|
||||||
{{if .customBackground}}
|
{{template "common/head" .}}
|
||||||
{{.customBackground|unescaped}}
|
|
||||||
{{end}}
|
|
||||||
{{if .customHeader}}
|
|
||||||
{{.customHeader|unescaped}}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{if .siteIcon}}
|
|
||||||
{{.siteIcon|unescaped}}
|
|
||||||
{{end}}
|
|
||||||
{{if .customCss}}
|
|
||||||
{{.customCss|unescaped}}
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
|
@ -1,13 +1,8 @@
|
||||||
package twentyfifteen
|
package twentyfifteen
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/fthvgb1/wp-go/helper/slice"
|
|
||||||
"github.com/fthvgb1/wp-go/internal/pkg/cache"
|
|
||||||
"github.com/fthvgb1/wp-go/internal/pkg/constraints"
|
"github.com/fthvgb1/wp-go/internal/pkg/constraints"
|
||||||
"github.com/fthvgb1/wp-go/internal/pkg/logs"
|
|
||||||
"github.com/fthvgb1/wp-go/internal/pkg/models"
|
|
||||||
"github.com/fthvgb1/wp-go/internal/theme/common"
|
"github.com/fthvgb1/wp-go/internal/theme/common"
|
||||||
"github.com/gin-gonic/gin"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const ThemeName = "twentyfifteen"
|
const ThemeName = "twentyfifteen"
|
||||||
|
@ -49,27 +44,3 @@ func (h *handle) Detail() {
|
||||||
h.CustomHeader()
|
h.CustomHeader()
|
||||||
h.Details()
|
h.Details()
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHeaderImage(c *gin.Context) (r models.PostThumbnail) {
|
|
||||||
r.Path = "/wp-content/themes/twentyseventeen/assets/images/header.jpg"
|
|
||||||
r.Width = 2000
|
|
||||||
r.Height = 1200
|
|
||||||
hs, err := cache.GetHeaderImages(c, ThemeName)
|
|
||||||
if err != nil {
|
|
||||||
logs.ErrPrintln(err, "获取页眉背景图失败")
|
|
||||||
} else if len(hs) > 0 && err == nil {
|
|
||||||
_, r = slice.Rand(hs)
|
|
||||||
|
|
||||||
}
|
|
||||||
r.Sizes = "100vw"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func ThemeSupport() map[string]struct{} {
|
|
||||||
return map[string]struct{}{
|
|
||||||
"custom-background": {},
|
|
||||||
"wp-custom-logo": {},
|
|
||||||
"responsive-embeds": {},
|
|
||||||
"post-formats": {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
<div class="site-branding" style="margin-bottom: 0px;">
|
<div class="site-branding" style="margin-bottom: 0px;">
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
|
{{template "common/customLogo" .}}
|
||||||
<div class="site-branding-text">
|
<div class="site-branding-text">
|
||||||
<h1 class="site-title">
|
<h1 class="site-title">
|
||||||
<a href="/" rel="home">{{ "blogname"| getOption }}</a>
|
<a href="/" rel="home">{{ "blogname"| getOption }}</a>
|
||||||
|
|
|
@ -64,4 +64,7 @@
|
||||||
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/wp-includes/wlwmanifest.xml" />
|
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/wp-includes/wlwmanifest.xml" />
|
||||||
<meta name="generator" content="WordPress 6.1.1" />
|
<meta name="generator" content="WordPress 6.1.1" />
|
||||||
<style>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
|
<style>.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
|
||||||
|
|
||||||
|
{{template "common/head" .}}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
134
internal/theme/twentyseventeen/themesupport.json
Normal file
134
internal/theme/twentyseventeen/themesupport.json
Normal file
|
@ -0,0 +1,134 @@
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
|
@ -82,11 +82,9 @@ func (i *indexHandle) Index() {
|
||||||
i.C.HTML(i.Code, i.Templ, i.GinH)
|
i.C.HTML(i.Code, i.Templ, i.GinH)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
i.PostsPlugins = pluginFns
|
||||||
i.PageEle = paginate
|
i.PageEle = paginate
|
||||||
i.ExecListPagePlugin(pluginFns)
|
i.Render()
|
||||||
i.Pagination()
|
|
||||||
i.GinH["bodyClass"] = i.h.bodyClass()
|
|
||||||
i.C.HTML(i.Code, i.Templ, i.GinH)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *detailHandle) Detail() {
|
func (d *detailHandle) Detail() {
|
||||||
|
@ -105,12 +103,10 @@ func (d *detailHandle) Detail() {
|
||||||
img.Sizes = "100vw"
|
img.Sizes = "100vw"
|
||||||
img.Srcset = fmt.Sprintf("%s %dw, %s", img.Path, img.Width, img.Srcset)
|
img.Srcset = fmt.Sprintf("%s %dw, %s", img.Path, img.Width, img.Srcset)
|
||||||
d.Post.Thumbnail = img
|
d.Post.Thumbnail = img
|
||||||
d.GinH["post"] = d.Post
|
|
||||||
d.CommentRender = commentFormat
|
d.CommentRender = commentFormat
|
||||||
d.RenderComment()
|
d.GinH["post"] = d.Post
|
||||||
d.PasswordProject()
|
d.Render()
|
||||||
d.Templ = "twentyseventeen/posts/detail.gohtml"
|
|
||||||
d.C.HTML(d.Code, d.Templ, d.GinH)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var commentFormat = comment{}
|
var commentFormat = comment{}
|
||||||
|
@ -195,12 +191,3 @@ var class = map[int]string{
|
||||||
constraints.Search: "search ",
|
constraints.Search: "search ",
|
||||||
constraints.Detail: "post-template-default single single-post single-format-standard ",
|
constraints.Detail: "post-template-default single single-post single-format-standard ",
|
||||||
}
|
}
|
||||||
|
|
||||||
func ThemeSupport() map[string]struct{} {
|
|
||||||
return map[string]struct{}{
|
|
||||||
"custom-header": {},
|
|
||||||
"wp-custom-logo": {},
|
|
||||||
"responsive-embeds": {},
|
|
||||||
"post-formats": {},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ func SetTemplateFs(fs embed.FS) {
|
||||||
templateFs = fs
|
templateFs = fs
|
||||||
}
|
}
|
||||||
|
|
||||||
type ThemeMods struct {
|
type ThemeMod struct {
|
||||||
CustomCssPostId int `json:"custom_css_post_id,omitempty"`
|
CustomCssPostId int `json:"custom_css_post_id,omitempty"`
|
||||||
NavMenuLocations []string `json:"nav_menu_locations,omitempty"`
|
NavMenuLocations []string `json:"nav_menu_locations,omitempty"`
|
||||||
CustomLogo int `json:"custom_logo,omitempty"`
|
CustomLogo int `json:"custom_logo,omitempty"`
|
||||||
|
@ -103,13 +103,13 @@ func Thumbnail(metadata models.WpAttachmentMetadata, Type, host string, except .
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var themeModes = safety.Map[string, ThemeMods]{}
|
var themeModes = safety.Map[string, ThemeMod]{}
|
||||||
|
|
||||||
func FlushModes() {
|
func FlushModes() {
|
||||||
themeModes.Flush()
|
themeModes.Flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetThemeMods(theme string) (r ThemeMods, err error) {
|
func GetThemeMods(theme string) (r ThemeMod, err error) {
|
||||||
r, ok := themeModes.Load(theme)
|
r, ok := themeModes.Load(theme)
|
||||||
if ok {
|
if ok {
|
||||||
return
|
return
|
||||||
|
@ -119,7 +119,7 @@ func GetThemeMods(theme string) (r ThemeMods, err error) {
|
||||||
if !ok || mods == "" {
|
if !ok || mods == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
r, err = phphelper.UnPHPSerialize[ThemeMods](mods)
|
r, err = phphelper.UnPHPSerialize[ThemeMod](mods)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ func IsCustomBackground(theme string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ThemeMods) setThemeColorScheme(themeName string) {
|
func (m *ThemeMod) setThemeColorScheme(themeName string) {
|
||||||
bytes, err := templateFs.ReadFile(filepath.Join(themeName, "colorscheme.json"))
|
bytes, err := templateFs.ReadFile(filepath.Join(themeName, "colorscheme.json"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
@ -153,7 +153,7 @@ func (m *ThemeMods) setThemeColorScheme(themeName string) {
|
||||||
}
|
}
|
||||||
m.ColorScheme = scheme
|
m.ColorScheme = scheme
|
||||||
}
|
}
|
||||||
func (m *ThemeMods) setThemeSupport(themeName string) {
|
func (m *ThemeMod) setThemeSupport(themeName string) {
|
||||||
bytes, err := templateFs.ReadFile(filepath.Join(themeName, "themesupport.json"))
|
bytes, err := templateFs.ReadFile(filepath.Join(themeName, "themesupport.json"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|
|
@ -4,7 +4,8 @@ type ThemeSupport struct {
|
||||||
CoreBlockPatterns bool `json:"core-block-patterns"`
|
CoreBlockPatterns bool `json:"core-block-patterns"`
|
||||||
WidgetsBlockEditor bool `json:"widgets-block-editor"`
|
WidgetsBlockEditor bool `json:"widgets-block-editor"`
|
||||||
AutomaticFeedLinks bool `json:"automatic-feed-links"`
|
AutomaticFeedLinks bool `json:"automatic-feed-links"`
|
||||||
TitleTag bool `json:"title-tag"`
|
TitleTag bool
|
||||||
|
CustomLineHeight bool `json:"title-tag"`
|
||||||
PostThumbnails bool `json:"post-thumbnails"`
|
PostThumbnails bool `json:"post-thumbnails"`
|
||||||
Menus bool `json:"menus"`
|
Menus bool `json:"menus"`
|
||||||
HTML5 []string `json:"html5"`
|
HTML5 []string `json:"html5"`
|
||||||
|
@ -18,6 +19,7 @@ type ThemeSupport struct {
|
||||||
EditorColorPalette []EditorColorPalette `json:"editor-color-palette"`
|
EditorColorPalette []EditorColorPalette `json:"editor-color-palette"`
|
||||||
EditorGradientPresets []EditorGradientPresets `json:"editor-gradient-presets"`
|
EditorGradientPresets []EditorGradientPresets `json:"editor-gradient-presets"`
|
||||||
CustomizeSelectiveRefreshWidgets bool `json:"customize-selective-refresh-widgets"`
|
CustomizeSelectiveRefreshWidgets bool `json:"customize-selective-refresh-widgets"`
|
||||||
|
StarterContent StarterContent `json:"starter-content"`
|
||||||
CustomHeader CustomHeader `json:"custom-header"`
|
CustomHeader CustomHeader `json:"custom-header"`
|
||||||
Widgets bool `json:"widgets"`
|
Widgets bool `json:"widgets"`
|
||||||
}
|
}
|
||||||
|
@ -29,6 +31,23 @@ type CustomLogo struct {
|
||||||
HeaderText string `json:"header-text"`
|
HeaderText string `json:"header-text"`
|
||||||
UnlinkHomepageLogo bool `json:"unlink-homepage-logo"`
|
UnlinkHomepageLogo bool `json:"unlink-homepage-logo"`
|
||||||
}
|
}
|
||||||
|
type Widgets struct {
|
||||||
|
Sidebar1 []string `json:"sidebar-1"`
|
||||||
|
Sidebar2 []string `json:"sidebar-2"`
|
||||||
|
Sidebar3 []string `json:"sidebar-3"`
|
||||||
|
}
|
||||||
|
type About struct {
|
||||||
|
Thumbnail string `json:"thumbnail"`
|
||||||
|
}
|
||||||
|
type Contact struct {
|
||||||
|
Thumbnail string `json:"thumbnail"`
|
||||||
|
}
|
||||||
|
type Blog struct {
|
||||||
|
Thumbnail string `json:"thumbnail"`
|
||||||
|
}
|
||||||
|
type HomepageSection struct {
|
||||||
|
Thumbnail string `json:"thumbnail"`
|
||||||
|
}
|
||||||
type CustomBackground struct {
|
type CustomBackground struct {
|
||||||
DefaultImage string `json:"default-image"`
|
DefaultImage string `json:"default-image"`
|
||||||
DefaultPreset string `json:"default-preset"`
|
DefaultPreset string `json:"default-preset"`
|
||||||
|
@ -52,6 +71,62 @@ type EditorGradientPresets struct {
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
Gradient string `json:"gradient"`
|
Gradient string `json:"gradient"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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"`
|
||||||
|
}
|
||||||
|
type ImageSandwich struct {
|
||||||
|
PostTitle string `json:"post_title"`
|
||||||
|
File string `json:"file"`
|
||||||
|
}
|
||||||
|
type ImageCoffee struct {
|
||||||
|
PostTitle string `json:"post_title"`
|
||||||
|
File string `json:"file"`
|
||||||
|
}
|
||||||
|
type Attachments struct {
|
||||||
|
ImageEspresso ImageEspresso `json:"image-espresso"`
|
||||||
|
ImageSandwich ImageSandwich `json:"image-sandwich"`
|
||||||
|
ImageCoffee ImageCoffee `json:"image-coffee"`
|
||||||
|
}
|
||||||
|
type Option struct {
|
||||||
|
ShowOnFront string `json:"show_on_front"`
|
||||||
|
PageOnFront string `json:"page_on_front"`
|
||||||
|
PageForPosts string `json:"page_for_posts"`
|
||||||
|
}
|
||||||
|
type ThemeMods struct {
|
||||||
|
Panel1 string `json:"panel_1"`
|
||||||
|
Panel2 string `json:"panel_2"`
|
||||||
|
Panel3 string `json:"panel_3"`
|
||||||
|
Panel4 string `json:"panel_4"`
|
||||||
|
}
|
||||||
|
type Top 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 Option `json:"options"`
|
||||||
|
ThemeMods ThemeMods `json:"theme_mods"`
|
||||||
|
NavMenus NavMenus `json:"nav_menus"`
|
||||||
|
}
|
||||||
type CustomHeader struct {
|
type CustomHeader struct {
|
||||||
DefaultImage string `json:"default-image"`
|
DefaultImage string `json:"default-image"`
|
||||||
RandomDefault bool `json:"random-default"`
|
RandomDefault bool `json:"random-default"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user