aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/client.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index df2eee9c9..b5dc7b7ed 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -100,11 +100,12 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
100 '@type': 'VideoObject', 100 '@type': 'VideoObject',
101 name: videoNameEscaped, 101 name: videoNameEscaped,
102 description: videoDescriptionEscaped, 102 description: videoDescriptionEscaped,
103 thumbnailUrl: previewUrl,
104 uploadDate: video.createdAt.toISOString(),
103 duration: video.getActivityStreamDuration(), 105 duration: video.getActivityStreamDuration(),
104 thumbnailURL: previewUrl, 106 contentUrl: videoUrl,
105 contentURL: videoUrl, 107 embedUrl: embedUrl,
106 embedURL: embedUrl, 108 interactionCount: video.views
107 uploadDate: video.createdAt
108 } 109 }
109 110
110 let tagsString = '' 111 let tagsString = ''
@@ -124,6 +125,9 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
124 // Schema.org 125 // Schema.org
125 tagsString += `<script type="application/ld+json">${JSON.stringify(schemaTags)}</script>` 126 tagsString += `<script type="application/ld+json">${JSON.stringify(schemaTags)}</script>`
126 127
128 // SEO
129 tagsString += `<link rel="canonical" href="${videoUrl}" />`
130
127 return htmlStringPage.replace(OPENGRAPH_AND_OEMBED_COMMENT, tagsString) 131 return htmlStringPage.replace(OPENGRAPH_AND_OEMBED_COMMENT, tagsString)
128} 132}
129 133