diff options
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r-- | server/lib/client-html.ts | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 3e6da2898..5996f3c70 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/models/i18n/i18n' | 2 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/models/i18n/i18n' |
3 | import { CUSTOM_HTML_TAG_COMMENTS, EMBED_SIZE, PLUGIN_GLOBAL_CSS_PATH, WEBSERVER } from '../initializers/constants' | 3 | import { CUSTOM_HTML_TAG_COMMENTS, EMBED_SIZE, PLUGIN_GLOBAL_CSS_PATH, WEBSERVER, FILES_CONTENT_HASH } from '../initializers/constants' |
4 | import { join } from 'path' | 4 | import { join } from 'path' |
5 | import { escapeHTML, sha256 } from '../helpers/core-utils' | 5 | import { escapeHTML, sha256 } from '../helpers/core-utils' |
6 | import { VideoModel } from '../models/video/video' | 6 | import { VideoModel } from '../models/video/video' |
@@ -101,6 +101,9 @@ export class ClientHtml { | |||
101 | let html = buffer.toString() | 101 | let html = buffer.toString() |
102 | 102 | ||
103 | if (paramLang) html = ClientHtml.addHtmlLang(html, paramLang) | 103 | if (paramLang) html = ClientHtml.addHtmlLang(html, paramLang) |
104 | html = ClientHtml.addManifestContentHash(html) | ||
105 | html = ClientHtml.addFaviconContentHash(html) | ||
106 | html = ClientHtml.addLogoContentHash(html) | ||
104 | html = ClientHtml.addCustomCSS(html) | 107 | html = ClientHtml.addCustomCSS(html) |
105 | html = await ClientHtml.addAsyncPluginCSS(html) | 108 | html = await ClientHtml.addAsyncPluginCSS(html) |
106 | 109 | ||
@@ -136,6 +139,18 @@ export class ClientHtml { | |||
136 | return htmlStringPage.replace('<html>', `<html lang="${paramLang}">`) | 139 | return htmlStringPage.replace('<html>', `<html lang="${paramLang}">`) |
137 | } | 140 | } |
138 | 141 | ||
142 | private static addManifestContentHash (htmlStringPage: string) { | ||
143 | return htmlStringPage.replace('[manifestContentHash]', FILES_CONTENT_HASH.MANIFEST) | ||
144 | } | ||
145 | |||
146 | private static addFaviconContentHash(htmlStringPage: string) { | ||
147 | return htmlStringPage.replace('[faviconContentHash]', FILES_CONTENT_HASH.FAVICON) | ||
148 | } | ||
149 | |||
150 | private static addLogoContentHash(htmlStringPage: string) { | ||
151 | return htmlStringPage.replace('[logoContentHash]', FILES_CONTENT_HASH.LOGO) | ||
152 | } | ||
153 | |||
139 | private static addTitleTag (htmlStringPage: string, title?: string) { | 154 | private static addTitleTag (htmlStringPage: string, title?: string) { |
140 | let text = title || CONFIG.INSTANCE.NAME | 155 | let text = title || CONFIG.INSTANCE.NAME |
141 | if (title) text += ` - ${CONFIG.INSTANCE.NAME}` | 156 | if (title) text += ` - ${CONFIG.INSTANCE.NAME}` |