Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix: missing url title for PermalinkQuestionIDAndTitleByShortID

sy-records211659a5bf0b
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)