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:
Gabe Kangas
2023-05-30 11:09:51 -07:00
committed by GitHub
parent d5fd76d796
commit 15dc718e61
10 changed files with 122 additions and 2 deletions

View File

@@ -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
}