From aa6524a2469959f141558a7640d78d91819283f8 Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:50:40 +0800 Subject: [PATCH] update custom.css --- .../siteinfo_controller.go | 16 +++++++ internal/router/template_router.go | 1 + ui/build/index.html | 48 ++++++++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/internal/controller_backyard/siteinfo_controller.go b/internal/controller_backyard/siteinfo_controller.go index 09a8bba3..048a905a 100644 --- a/internal/controller_backyard/siteinfo_controller.go +++ b/internal/controller_backyard/siteinfo_controller.go @@ -155,6 +155,22 @@ func (sc *SiteInfoController) GetRobots(ctx *gin.Context) { ctx.String(http.StatusOK, resp.Robots) } +// GetRobots get site robots information +// @Summary get site robots information +// @Description get site robots information +// @Tags site +// @Produce json +// @Success 200 {string} txt "" +// @Router /custom.css [get] +func (sc *SiteInfoController) GetCss(ctx *gin.Context) { + resp, err := sc.siteInfoService.GetSiteCustomCssHTML(ctx) + if err != nil { + ctx.String(http.StatusOK, "") + return + } + ctx.String(http.StatusOK, resp.CustomCss) +} + // UpdateSeo update site seo information // @Summary update site seo information // @Description update site seo information diff --git a/internal/router/template_router.go b/internal/router/template_router.go index f7c25dd8..3ee5871e 100644 --- a/internal/router/template_router.go +++ b/internal/router/template_router.go @@ -32,6 +32,7 @@ func (a *TemplateRouter) RegisterTemplateRouter(r *gin.RouterGroup) { r.GET("/sitemap/:page", a.templateController.SitemapPage) r.GET("/robots.txt", a.siteInfoController.GetRobots) + r.GET("/custom.css", a.siteInfoController.GetCss) r.GET("/", a.templateController.Index) r.GET("/index", a.templateController.Index) diff --git a/ui/build/index.html b/ui/build/index.html index 48e3360b..430813a0 100644 --- a/ui/build/index.html +++ b/ui/build/index.html @@ -1 +1,47 @@ -Answer
\ No newline at end of file + + + + + + + + + Answer + + + {{.HeadCode}} + + + {{.HeaderCode}} + +
+ +
+
+ + {{.FooterCode}} +