mirror of https://gitee.com/answerdev/answer.git
add title
This commit is contained in:
parent
952e3d86fa
commit
ec739310bb
|
@ -388,6 +388,10 @@ func (tc *TemplateController) html(ctx *gin.Context, code int, tpl string, siteI
|
|||
if siteInfo.Description == "" {
|
||||
siteInfo.Description = siteInfo.General.Description
|
||||
}
|
||||
data["title"] = siteInfo.Title
|
||||
if siteInfo.Title == "" {
|
||||
data["title"] = siteInfo.General.Name
|
||||
}
|
||||
data["description"] = siteInfo.Description
|
||||
data["language"] = handler.GetLang(ctx)
|
||||
data["timezone"] = siteInfo.Interface.TimeZone
|
||||
|
|
|
@ -109,6 +109,7 @@ type TemplateSiteInfoResp struct {
|
|||
General *SiteGeneralResp `json:"general"`
|
||||
Interface *SiteInterfaceResp `json:"interface"`
|
||||
Branding *SiteBrandingResp `json:"branding"`
|
||||
Title string
|
||||
Year string
|
||||
Canonical string
|
||||
JsonLD string
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title>{{.title}}</title>
|
||||
<meta name="description" content="{{.description}}" />
|
||||
{{if .keywords }}<meta name="keywords" content="{{.keywords}}" />{{end}}
|
||||
<link rel="canonical" href="{{.siteinfo.Canonical}}" />
|
||||
|
|
Loading…
Reference in New Issue