aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-08 10:53:41 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-08 11:15:11 +0100
commita59f210ff3a4cc87dd19aeaaf0f43f63a8310791 (patch)
tree82ffcc8f6dcee07ad0776a5d3937f8953a958bf8 /server/lib
parente5024f5181b2e8ec23a58a821671000041b5bf2b (diff)
downloadPeerTube-a59f210ff3a4cc87dd19aeaaf0f43f63a8310791.tar.gz
PeerTube-a59f210ff3a4cc87dd19aeaaf0f43f63a8310791.tar.zst
PeerTube-a59f210ff3a4cc87dd19aeaaf0f43f63a8310791.zip
Refactor a little bit client canonical URL
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/client-html.ts37
1 files changed, 33 insertions, 4 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index 211ac3342..d97d23180 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -117,7 +117,16 @@ export class ClientHtml {
117 const schemaType = 'VideoObject' 117 const schemaType = 'VideoObject'
118 118
119 customHtml = ClientHtml.addTags(customHtml, { 119 customHtml = ClientHtml.addTags(customHtml, {
120 url, originUrl, siteName, title, description, image, embed, ogType, twitterCard, schemaType 120 url,
121 originUrl,
122 siteName,
123 title,
124 description,
125 image,
126 embed,
127 ogType,
128 twitterCard,
129 schemaType
121 }) 130 })
122 131
123 return customHtml 132 return customHtml
@@ -168,7 +177,17 @@ export class ClientHtml {
168 const schemaType = 'ItemList' 177 const schemaType = 'ItemList'
169 178
170 customHtml = ClientHtml.addTags(customHtml, { 179 customHtml = ClientHtml.addTags(customHtml, {
171 url, originUrl, siteName, embed, title, description, image, list, ogType, twitterCard, schemaType 180 url,
181 originUrl,
182 siteName,
183 embed,
184 title,
185 description,
186 image,
187 list,
188 ogType,
189 twitterCard,
190 schemaType
172 }) 191 })
173 192
174 return customHtml 193 return customHtml
@@ -216,7 +235,7 @@ export class ClientHtml {
216 let customHtml = ClientHtml.addTitleTag(html, escapeHTML(entity.getDisplayName())) 235 let customHtml = ClientHtml.addTitleTag(html, escapeHTML(entity.getDisplayName()))
217 customHtml = ClientHtml.addDescriptionTag(customHtml, escapeHTML(entity.description)) 236 customHtml = ClientHtml.addDescriptionTag(customHtml, escapeHTML(entity.description))
218 237
219 const url = entity.Actor.url 238 const url = entity.getLocalUrl()
220 const originUrl = entity.Actor.url 239 const originUrl = entity.Actor.url
221 const siteName = escapeHTML(CONFIG.INSTANCE.NAME) 240 const siteName = escapeHTML(CONFIG.INSTANCE.NAME)
222 const title = escapeHTML(entity.getDisplayName()) 241 const title = escapeHTML(entity.getDisplayName())
@@ -232,7 +251,17 @@ export class ClientHtml {
232 const twitterCard = 'summary' 251 const twitterCard = 'summary'
233 const schemaType = 'ProfilePage' 252 const schemaType = 'ProfilePage'
234 253
235 customHtml = ClientHtml.addTags(customHtml, { url, originUrl, title, siteName, description, image, ogType, twitterCard, schemaType }) 254 customHtml = ClientHtml.addTags(customHtml, {
255 url,
256 originUrl,
257 title,
258 siteName,
259 description,
260 image,
261 ogType,
262 twitterCard,
263 schemaType
264 })
236 265
237 return customHtml 266 return customHtml
238 } 267 }