From 40f66f505c81c8081bf6fb128d07ef99c3487f6c Mon Sep 17 00:00:00 2001 From: aichy126 <16996097+aichy126@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:25:25 +0800 Subject: [PATCH] update seo perma link --- internal/controller/template_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/controller/template_controller.go b/internal/controller/template_controller.go index e9048ae3..cf9dd5ee 100644 --- a/internal/controller/template_controller.go +++ b/internal/controller/template_controller.go @@ -184,9 +184,9 @@ func (tc *TemplateController) QuestionInfoeRdirect(ctx *gin.Context, siteInfo *s titleIsAnswerID = true } } - + siteInfo = tc.SiteInfo(ctx) url = fmt.Sprintf("%s/questions/%s", siteInfo.General.SiteUrl, id) - if siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionID { + if siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionID || siteInfo.SiteSeo.PermaLink == schema.PermaLinkQuestionIDByShortID { if len(ctx.Request.URL.Query()) > 0 { url = fmt.Sprintf("%s?%s", url, ctx.Request.URL.RawQuery) }