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
|
||||
AvatarUrl string
|
||||
FullUrl string
|
||||
HtmlHeadExtra string
|
||||
FooterExtra string
|
||||
}
|
||||
|
|
|
@ -60,7 +60,8 @@
|
|||
object-fit: cover;
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
{{ .SiteConfig.HtmlHeadExtra }}
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
@ -115,6 +116,7 @@
|
|||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
{{ .SiteConfig.FooterExtra}}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -34,6 +34,12 @@
|
|||
<label for="FullUrl">FullUrl</label>
|
||||
<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" />
|
||||
</form>
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@ func (h *SiteConfigHandler) HandlePost(c *fiber.Ctx) error {
|
|||
siteConfig.AuthorName = c.FormValue("AuthorName")
|
||||
siteConfig.AvatarUrl = c.FormValue("AvatarUrl")
|
||||
siteConfig.FullUrl = c.FormValue("FullUrl")
|
||||
siteConfig.HtmlHeadExtra = c.FormValue("HtmlHeadExtra")
|
||||
siteConfig.FooterExtra = c.FormValue("FooterExtra")
|
||||
|
||||
err = h.siteConfigRepo.Update(config.SITE_CONFIG, siteConfig)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue