aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/client-html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r--server/lib/client-html.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index e59505614..1d8a08ed0 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -26,7 +26,9 @@ export class ClientHtml {
26 } 26 }
27 27
28 static async getDefaultHTMLPage (req: express.Request, res: express.Response, paramLang?: string) { 28 static async getDefaultHTMLPage (req: express.Request, res: express.Response, paramLang?: string) {
29 const html = await ClientHtml.getIndexHTML(req, res, paramLang) 29 const html = paramLang
30 ? await ClientHtml.getIndexHTML(req, res, paramLang)
31 : await ClientHtml.getIndexHTML(req, res)
30 32
31 let customHtml = ClientHtml.addTitleTag(html) 33 let customHtml = ClientHtml.addTitleTag(html)
32 customHtml = ClientHtml.addDescriptionTag(customHtml) 34 customHtml = ClientHtml.addDescriptionTag(customHtml)
@@ -98,6 +100,7 @@ export class ClientHtml {
98 100
99 let html = buffer.toString() 101 let html = buffer.toString()
100 102
103 if (paramLang) html = ClientHtml.addHtmlLang(html, paramLang)
101 html = ClientHtml.addCustomCSS(html) 104 html = ClientHtml.addCustomCSS(html)
102 html = await ClientHtml.addAsyncPluginCSS(html) 105 html = await ClientHtml.addAsyncPluginCSS(html)
103 106
@@ -106,7 +109,7 @@ export class ClientHtml {
106 return html 109 return html
107 } 110 }
108 111
109 private static getIndexPath (req: express.Request, res: express.Response, paramLang?: string) { 112 private static getIndexPath (req: express.Request, res: express.Response, paramLang: string) {
110 let lang: string 113 let lang: string
111 114
112 // Check param lang validity 115 // Check param lang validity
@@ -129,6 +132,10 @@ export class ClientHtml {
129 return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html') 132 return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html')
130 } 133 }
131 134
135 private static addHtmlLang (htmlStringPage: string, paramLang: string) {
136 return htmlStringPage.replace('<html>', `<html lang="${paramLang}">`)
137 }
138
132 private static addTitleTag (htmlStringPage: string, title?: string) { 139 private static addTitleTag (htmlStringPage: string, title?: string) {
133 let text = title || CONFIG.INSTANCE.NAME 140 let text = title || CONFIG.INSTANCE.NAME
134 if (title) text += ` - ${CONFIG.INSTANCE.NAME}` 141 if (title) text += ` - ${CONFIG.INSTANCE.NAME}`