diff options
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r-- | server/lib/client-html.ts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index a557c090f..e093d35f7 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -44,6 +44,8 @@ type Tags = { | |||
44 | originUrl: string | 44 | originUrl: string |
45 | description: string | 45 | description: string |
46 | 46 | ||
47 | disallowIndexation?: boolean | ||
48 | |||
47 | embed?: { | 49 | embed?: { |
48 | url: string | 50 | url: string |
49 | createdAt: string | 51 | createdAt: string |
@@ -285,7 +287,8 @@ class ClientHtml { | |||
285 | image, | 287 | image, |
286 | ogType, | 288 | ogType, |
287 | twitterCard, | 289 | twitterCard, |
288 | schemaType | 290 | schemaType, |
291 | disallowIndexation: !entity.Actor.isOwned() | ||
289 | }) | 292 | }) |
290 | 293 | ||
291 | return customHtml | 294 | return customHtml |
@@ -488,7 +491,7 @@ class ClientHtml { | |||
488 | const twitterCardMetaTags = this.generateTwitterCardMetaTags(tagsValues) | 491 | const twitterCardMetaTags = this.generateTwitterCardMetaTags(tagsValues) |
489 | const schemaTags = this.generateSchemaTags(tagsValues) | 492 | const schemaTags = this.generateSchemaTags(tagsValues) |
490 | 493 | ||
491 | const { url, title, embed, originUrl } = tagsValues | 494 | const { url, title, embed, originUrl, disallowIndexation } = tagsValues |
492 | 495 | ||
493 | const oembedLinkTags: { type: string, href: string, title: string }[] = [] | 496 | const oembedLinkTags: { type: string, href: string, title: string }[] = [] |
494 | 497 | ||
@@ -536,6 +539,10 @@ class ClientHtml { | |||
536 | // SEO, use origin URL | 539 | // SEO, use origin URL |
537 | tagsString += `<link rel="canonical" href="${originUrl}" />` | 540 | tagsString += `<link rel="canonical" href="${originUrl}" />` |
538 | 541 | ||
542 | if (disallowIndexation) { | ||
543 | tagsString += `<meta name="robots" content="noindex" />` | ||
544 | } | ||
545 | |||
539 | return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.META_TAGS, tagsString) | 546 | return htmlStringPage.replace(CUSTOM_HTML_TAG_COMMENTS.META_TAGS, tagsString) |
540 | } | 547 | } |
541 | } | 548 | } |