option to add html header and footer html

This commit is contained in:
Niko Abeler 2023-07-24 21:27:51 +02:00
parent a38ebb61a9
commit 802e9a399e
4 changed files with 13 additions and 1 deletions

View File

@ -32,4 +32,6 @@ type SiteConfig struct {
Secret string
AvatarUrl string
FullUrl string
HtmlHeadExtra string
FooterExtra string
}

View File

@ -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>

View File

@ -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>

View File

@ -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 {