summaryrefslogtreecommitdiff
path: root/internal/web/profile.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-09-29 12:03:17 +0200
committerLibravatar GitHub <noreply@github.com>2022-09-29 12:03:17 +0200
commitdd83ad053c0cde5b948cbfe34ec4864cf0a123e3 (patch)
treedbd53c7a2c98003c0ad96727ceaa572e4f7aa0eb /internal/web/profile.go
parent[frontend] Unified panels (#812) (diff)
downloadgotosocial-dd83ad053c0cde5b948cbfe34ec4864cf0a123e3.tar.xz
[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
Diffstat (limited to 'internal/web/profile.go')
-rw-r--r--internal/web/profile.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/web/profile.go b/internal/web/profile.go
index a4332b0c1..a1518b517 100644
--- a/internal/web/profile.go
+++ b/internal/web/profile.go
@@ -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,