feat: add support for robots.txt disabling search indexing (#2929)
* feat: add support for robots.txt Can toggle disabling search engine indexing. Closes #2684 * fix: unexport ts const
This commit is contained in:
@@ -69,6 +69,7 @@ const (
|
||||
customOfflineMessageKey = "custom_offline_message"
|
||||
customColorVariableValuesKey = "custom_color_variable_values"
|
||||
streamKeysKey = "stream_keys"
|
||||
disableSearchIndexingKey = "disable_search_indexing"
|
||||
)
|
||||
|
||||
// GetExtraPageBodyContent will return the user-supplied body content.
|
||||
@@ -959,3 +960,17 @@ func SetStreamKeys(actions []models.StreamKey) error {
|
||||
configEntry := ConfigEntry{Key: streamKeysKey, Value: actions}
|
||||
return _datastore.Save(configEntry)
|
||||
}
|
||||
|
||||
// SetDisableSearchIndexing will set if the web server should be indexable.
|
||||
func SetDisableSearchIndexing(disableSearchIndexing bool) error {
|
||||
return _datastore.SetBool(disableSearchIndexingKey, disableSearchIndexing)
|
||||
}
|
||||
|
||||
// GetDisableSearchIndexing will return if the web server should be indexable.
|
||||
func GetDisableSearchIndexing() bool {
|
||||
disableSearchIndexing, err := _datastore.GetBool(disableSearchIndexingKey)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return disableSearchIndexing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user