修复样式bug

This commit is contained in:
xing 2023-02-19 13:42:07 +08:00
parent a18616f50f
commit d043e75dfd
4 changed files with 11 additions and 12 deletions

View File

@ -30,7 +30,7 @@ func (h *Handle) CalSiteIcon() (r string) {
case "site_icon-270": case "site_icon-270":
return fmt.Sprintf(`<meta name="msapplication-TileImage" content="/wp-content/uploads/%s/%s" />`, m, s.File), true return fmt.Sprintf(`<meta name="msapplication-TileImage" content="/wp-content/uploads/%s/%s" />`, m, s.File), true
case "site_icon-180": case "site_icon-180":
return fmt.Sprintf(`<link rel="apple-touch-icon" href="/wp-content/uploads/%s/%s" />"`, m, s.File), true return fmt.Sprintf(`<link rel="apple-touch-icon" href="/wp-content/uploads/%s/%s" />`, m, s.File), true
default: default:
ss := strings.Replace(t, "site_icon-", "", 1) ss := strings.Replace(t, "site_icon-", "", 1)
return fmt.Sprintf(`<link rel="icon" href="/wp-content/uploads/%s/%s" sizes="%sx%s" />`, m, s.File, ss, ss), true return fmt.Sprintf(`<link rel="icon" href="/wp-content/uploads/%s/%s" sizes="%sx%s" />`, m, s.File, ss, ss), true

View File

@ -11,7 +11,7 @@ func (h *handle) colorSchemeCss() string {
s := slice.Filter([]string{h.calColorSchemeCss(), h.calSidebarTextColorCss(), h.calHeaderBackgroundColorCss()}, func(s string) bool { s := slice.Filter([]string{h.calColorSchemeCss(), h.calSidebarTextColorCss(), h.calHeaderBackgroundColorCss()}, func(s string) bool {
return s != "" return s != ""
}) })
return fmt.Sprintf(`<style id='%s-inline-css'%s>\n%s\n</style>\n`, "twentyfifteen-style", "", strings.Join(s, "\n")) return fmt.Sprintf(`<style id='%s-inline-css'%s>\n%s\n</style>`, "twentyfifteen-style", "", strings.Join(s, "\n"))
} }
func (h *handle) calColorSchemeCss() (r string) { func (h *handle) calColorSchemeCss() (r string) {
color := h.getColorScheme() color := h.getColorScheme()

View File

@ -1,11 +1,8 @@
{{ define "layout/base"}} {{ define "layout/base"}}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{getLang}}" class="no-js"> <html lang="{{getLang}}" class="no-js">
<head>
{{template "layout/head" .}} {{template "layout/head" .}}
{{block "head" .}}
{{end}}
</head>
<body class="{{.bodyClass}}"> <body class="{{.bodyClass}}">
{{template "svg"}} {{template "svg"}}
<div id="page" class="hfeed site"> <div id="page" class="hfeed site">

View File

@ -1,4 +1,5 @@
{{define "layout/head"}} {{define "layout/head"}}
<head>
<meta charset="{{"blog_charset"| getOption}}"> <meta charset="{{"blog_charset"| getOption}}">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="profile" href="https://gmpg.org/xfn/11"> <link rel="profile" href="https://gmpg.org/xfn/11">
@ -44,6 +45,9 @@
<link rel='stylesheet' id='twentyfifteen-fonts-css' href='/wp-includes/css/googleapicss.css' media='all' /> <link rel='stylesheet' id='twentyfifteen-fonts-css' href='/wp-includes/css/googleapicss.css' media='all' />
<link rel='stylesheet' id='genericons-css' href='/wp-content/themes/twentyfifteen/genericons/genericons.css?ver=20201208' media='all' /> <link rel='stylesheet' id='genericons-css' href='/wp-content/themes/twentyfifteen/genericons/genericons.css?ver=20201208' media='all' />
<link rel='stylesheet' id='twentyfifteen-style-css' href='/wp-content/themes/twentyfifteen/style.css?ver=20201208' media='all' /> <link rel='stylesheet' id='twentyfifteen-style-css' href='/wp-content/themes/twentyfifteen/style.css?ver=20201208' media='all' />
{{if .colorScheme}}
{{.colorScheme|unescaped}}
{{end}}
<link rel='stylesheet' id='twentyfifteen-block-style-css' href='/wp-content/themes/twentyfifteen/css/blocks.css?ver=20220524' media='all' /> <link rel='stylesheet' id='twentyfifteen-block-style-css' href='/wp-content/themes/twentyfifteen/css/blocks.css?ver=20220524' media='all' />
<!--[if lt IE 9]> <!--[if lt IE 9]>
<link rel='stylesheet' id='twentyfifteen-ie-css' href='/wp-content/themes/twentyfifteen/css/ie.css?ver=20170916' media='all' /> <link rel='stylesheet' id='twentyfifteen-ie-css' href='/wp-content/themes/twentyfifteen/css/ie.css?ver=20170916' media='all' />
@ -58,14 +62,12 @@
<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>
{{template "common/head" .}}
{{if .customBackground}} {{if .customBackground}}
{{.customBackground|unescaped}} {{.customBackground|unescaped}}
{{end}} {{end}}
{{if .colorScheme}} {{template "common/head" .}}
{{.colorScheme|unescaped}} {{block "head" .}}
{{end}} {{end}}
</head>
{{end}} {{end}}