From a59f210ff3a4cc87dd19aeaaf0f43f63a8310791 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Dec 2020 10:53:41 +0100 Subject: Refactor a little bit client canonical URL --- server/lib/client-html.ts | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'server/lib/client-html.ts') 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 { const schemaType = 'VideoObject' customHtml = ClientHtml.addTags(customHtml, { - url, originUrl, siteName, title, description, image, embed, ogType, twitterCard, schemaType + url, + originUrl, + siteName, + title, + description, + image, + embed, + ogType, + twitterCard, + schemaType }) return customHtml @@ -168,7 +177,17 @@ export class ClientHtml { const schemaType = 'ItemList' customHtml = ClientHtml.addTags(customHtml, { - url, originUrl, siteName, embed, title, description, image, list, ogType, twitterCard, schemaType + url, + originUrl, + siteName, + embed, + title, + description, + image, + list, + ogType, + twitterCard, + schemaType }) return customHtml @@ -216,7 +235,7 @@ export class ClientHtml { let customHtml = ClientHtml.addTitleTag(html, escapeHTML(entity.getDisplayName())) customHtml = ClientHtml.addDescriptionTag(customHtml, escapeHTML(entity.description)) - const url = entity.Actor.url + const url = entity.getLocalUrl() const originUrl = entity.Actor.url const siteName = escapeHTML(CONFIG.INSTANCE.NAME) const title = escapeHTML(entity.getDisplayName()) @@ -232,7 +251,17 @@ export class ClientHtml { const twitterCard = 'summary' const schemaType = 'ProfilePage' - customHtml = ClientHtml.addTags(customHtml, { url, originUrl, title, siteName, description, image, ogType, twitterCard, schemaType }) + customHtml = ClientHtml.addTags(customHtml, { + url, + originUrl, + title, + siteName, + description, + image, + ogType, + twitterCard, + schemaType + }) return customHtml } -- cgit v1.2.3