Merge branch 'feat/1.2.5/noindex' into test

This commit is contained in:
LinkinStars
2024-01-03 15:51:24 +08:00
2 changed files with 3 additions and 0 deletions
@@ -22,6 +22,7 @@ package controller
import (
"encoding/json"
"fmt"
"github.com/apache/incubator-answer/internal/entity"
"html/template"
"net/http"
"regexp"
@@ -376,6 +377,7 @@ func (tc *TemplateController) QuestionInfo(ctx *gin.Context) {
"detail": detail,
"answers": answers,
"comments": comments,
"noindex": detail.Show == entity.QuestionHide,
})
}
+1
View File
@@ -29,6 +29,7 @@
<meta name="description" content="{{.description}}" data-rh="true" />
<meta name="generator" content="Answer {{.Version}} - https://github.com/apache/incubator-answer version {{.Revision}}">
{{if .keywords }}<meta name="keywords" content="{{.keywords}}" data-rh="true" />{{end}}
{{if .noindex }}<meta name="robots" content="noindex">{{end}}
<link rel="canonical" href="{{.siteinfo.Canonical}}" />
<link rel="manifest" href="/manifest.json" />