option to add html header and footer html
This commit is contained in:
parent
a38ebb61a9
commit
802e9a399e
|
@ -32,4 +32,6 @@ type SiteConfig struct {
|
||||||
Secret string
|
Secret string
|
||||||
AvatarUrl string
|
AvatarUrl string
|
||||||
FullUrl string
|
FullUrl string
|
||||||
|
HtmlHeadExtra string
|
||||||
|
FooterExtra string
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
{{ .SiteConfig.HtmlHeadExtra }}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
@ -115,6 +116,7 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
{{ .SiteConfig.FooterExtra}}
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -34,6 +34,12 @@
|
||||||
<label for="FullUrl">FullUrl</label>
|
<label for="FullUrl">FullUrl</label>
|
||||||
<input type="text" name="FullUrl" id="FullUrl" value="{{.FullUrl}}"/>
|
<input type="text" name="FullUrl" id="FullUrl" value="{{.FullUrl}}"/>
|
||||||
|
|
||||||
|
<label for="HtmlHeadExtra">HtmlHeadExtra</label>
|
||||||
|
<textarea name="HtmlHeadExtra" id="HtmlHeadExtra">{{.HtmlHeadExtra}}</textarea>
|
||||||
|
|
||||||
|
<label for="FooterExtra">FooterExtra</label>
|
||||||
|
<textarea name="FooterExtra" id="FooterExtra">{{.FooterExtra}}</textarea>
|
||||||
|
|
||||||
<input type="submit" value="Save" />
|
<input type="submit" value="Save" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,8 @@ func (h *SiteConfigHandler) HandlePost(c *fiber.Ctx) error {
|
||||||
siteConfig.AuthorName = c.FormValue("AuthorName")
|
siteConfig.AuthorName = c.FormValue("AuthorName")
|
||||||
siteConfig.AvatarUrl = c.FormValue("AvatarUrl")
|
siteConfig.AvatarUrl = c.FormValue("AvatarUrl")
|
||||||
siteConfig.FullUrl = c.FormValue("FullUrl")
|
siteConfig.FullUrl = c.FormValue("FullUrl")
|
||||||
|
siteConfig.HtmlHeadExtra = c.FormValue("HtmlHeadExtra")
|
||||||
|
siteConfig.FooterExtra = c.FormValue("FooterExtra")
|
||||||
|
|
||||||
err = h.siteConfigRepo.Update(config.SITE_CONFIG, siteConfig)
|
err = h.siteConfigRepo.Update(config.SITE_CONFIG, siteConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue