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

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


The following commit(s) were added to refs/heads/dev by this push:
     new 211659a5 fix: missing url title for 
PermalinkQuestionIDAndTitleByShortID
211659a5 is described below

commit 211659a5bf0bd07ba4a164bade5e4f05a10c7301
Author: sy-records <[email protected]>
AuthorDate: Fri Sep 20 11:32:19 2024 +0800

    fix: missing url title for PermalinkQuestionIDAndTitleByShortID
---
 internal/controller/template_controller.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/internal/controller/template_controller.go 
b/internal/controller/template_controller.go
index 6b6a20f8..56a38f00 100644
--- a/internal/controller/template_controller.go
+++ b/internal/controller/template_controller.go
@@ -150,7 +150,8 @@ func (tc *TemplateController) Index(ctx *gin.Context) {
        siteInfo.Canonical = siteInfo.General.SiteUrl
 
        UrlUseTitle := false
-       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle {
+       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle ||
+               siteInfo.SiteSeo.Permalink == 
constant.PermalinkQuestionIDAndTitleByShortID {
                UrlUseTitle = true
        }
        siteInfo.Title = ""
@@ -183,7 +184,8 @@ func (tc *TemplateController) QuestionList(ctx 
*gin.Context) {
        }
 
        UrlUseTitle := false
-       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle {
+       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle ||
+               siteInfo.SiteSeo.Permalink == 
constant.PermalinkQuestionIDAndTitleByShortID {
                UrlUseTitle = true
        }
        siteInfo.Title = fmt.Sprintf("%s - %s", 
translator.Tr(handler.GetLang(ctx), constant.QuestionsTitleTrKey), 
siteInfo.General.Name)
@@ -466,7 +468,8 @@ func (tc *TemplateController) TagInfo(ctx *gin.Context) {
        siteInfo.Keywords = tagInfo.DisplayName
 
        UrlUseTitle := false
-       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle {
+       if siteInfo.SiteSeo.Permalink == constant.PermalinkQuestionIDAndTitle ||
+               siteInfo.SiteSeo.Permalink == 
constant.PermalinkQuestionIDAndTitleByShortID {
                UrlUseTitle = true
        }
        siteInfo.Title = fmt.Sprintf("'%s' %s - %s", tagInfo.DisplayName, 
translator.Tr(handler.GetLang(ctx), constant.QuestionsTitleTrKey), 
siteInfo.General.Name)

Reply via email to