From 3349ee2074dcfbfbade876a089651deeb1e398fc Mon Sep 17 00:00:00 2001 From: zouap Date: Fri, 31 Dec 2021 17:29:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zouap --- routers/home.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/routers/home.go b/routers/home.go index da25eb37e..4f0e535c3 100755 --- a/routers/home.go +++ b/routers/home.go @@ -44,6 +44,11 @@ const ( func Home(ctx *context.Context) { ctx.Data["PageIsHome"] = true ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled + setRecommendURL(ctx) + ctx.HTML(200, tplHome) +} + +func setRecommendURL(ctx *context.Context) { addr := setting.RecommentRepoAddr[10:] start := strings.Index(addr, "/") end := strings.Index(addr, "raw") @@ -52,7 +57,6 @@ func Home(ctx *context.Context) { } else { ctx.Data["RecommendURL"] = setting.RecommentRepoAddr } - ctx.HTML(200, tplHome) } func Dashboard(ctx *context.Context) { @@ -85,7 +89,7 @@ func Dashboard(ctx *context.Context) { ctx.Redirect(setting.AppSubURL + "/user/login") return } - + setRecommendURL(ctx) ctx.Data["PageIsHome"] = true ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled ctx.HTML(200, tplHome)