This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/main by this push:
     new 0267f4bd fix: canonical link error
0267f4bd is described below

commit 0267f4bd69b2bd4d127cb060c40504de0f51a11f
Author: sy-records <[email protected]>
AuthorDate: Wed Nov 22 16:08:47 2023 +0800

    fix: canonical link error
---
 internal/controller/template_controller.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/internal/controller/template_controller.go 
b/internal/controller/template_controller.go
index 40a98e3c..88e8ca0a 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -318,7 +318,7 @@ func (tc *TemplateController) QuestionInfo(ctx 
*gin.Context) {
                return
        }
        siteInfo.Canonical = fmt.Sprintf("%s/questions/%s/%s", 
siteInfo.General.SiteUrl, id, encodeTitle)
-       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionID {
+       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionID || 
siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDByShortID {
                siteInfo.Canonical = fmt.Sprintf("%s/questions/%s", 
siteInfo.General.SiteUrl, id)
        }
        jsonLD := &schema.QAPageJsonLD{}

Reply via email to