[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

@ -6,6 +6,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="{{ if .robotsMeta }}{{ .robotsMeta }}{{ else }}noindex, nofollow{{ end }}">
{{ if .ogMeta }}{{ if .ogMeta.Locale }}<meta name="og:locale" content="{{ .ogMeta.Locale }}">
{{ end }}<meta name="og:type" content="{{ .ogMeta.ResourceType }}">
<meta name="og:title" content="{{ .ogMeta.Title }}">

View file

@ -29,7 +29,7 @@
</div>
<h2 id="recent">Latest public toots</h2>
{{ if not .statuses }}
<div class="nothinghere">Nothing here!</div>
<div data-nosnippet class="nothinghere">Nothing here!</div>
{{ else }}
<div class="thread">
{{ range .statuses }}

View file

@ -1,4 +1,4 @@
<div class="contentgrid">
<div data-nosnippet class="contentgrid">
<a href="{{.Account.URL}}" class="avatar"><img src="{{.Account.Avatar}}" alt=""></a>
<a href="{{.Account.URL}}" class="displayname">{{if .Account.DisplayName}}{{emojify .Account.Emojis (escape .Account.DisplayName)}}{{else}}{{.Account.Username}}{{end}}</a>
<a href="{{.Account.URL}}" class="username">@{{.Account.Acct}}</a>
@ -52,4 +52,4 @@
<div id="favorites"><i aria-label="Favorites" class="fa fa-star"></i> {{.FavouritesCount}}</div>
</div>
</div>
<a href="{{.URL}}" class="toot-link">View toot</a>
<a data-nosnippet href="{{.URL}}" class="toot-link">View toot</a>

View file

@ -1,6 +1,6 @@
{{ template "header.tmpl" .}}
<main>
<div class="thread">
<div data-nosnippet class="thread">
{{range .context.Ancestors}}
<div class="toot">
{{ template "status.tmpl" .}}