[feature] Add meta robots tag; allow robots to index profile card if user is Discoverable (#842)

* rework robots.txt response

* don't let robots snippet from statuses/threads

* allow robots to index if user is Discoverable

* add license text
This commit is contained in:
tobi 2022-09-29 12:03:17 +02:00 committed by GitHub
commit dd83ad053c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 79 additions and 7 deletions

View file

@ -82,6 +82,12 @@ func (m *Module) profileGETHandler(c *gin.Context) {
return
}
// only allow search engines / robots to view this page if account is discoverable
var robotsMeta string
if account.Discoverable {
robotsMeta = robotsAllowSome
}
// we should only show the 'back to top' button if the
// profile visitor is paging through statuses
showBackToTop := false
@ -112,6 +118,7 @@ func (m *Module) profileGETHandler(c *gin.Context) {
"instance": instance,
"account": account,
"ogMeta": ogBase(instance).withAccount(account),
"robotsMeta": robotsMeta,
"statuses": statusResp.Items,
"statuses_next": statusResp.NextLink,
"show_back_to_top": showBackToTop,