proper dom position for title and favicon
Massimo Melina committed
Mar 3, 2024 at 12:36 UTC
ad80aefe5a67b48ac0bc5c09ba2ed49a82f74905
1 file changed
+3
-1
src/serveGuiFiles.ts
+3
-1
@@ -86,7 +86,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
86
const lang = await getLangData(ctx)
87
let ret = body
88
.replace(/((?:src|href) *= *['"])\/?(?!([a-z]+:\/)?\/)/g, '$1' + ctx.state.revProxyPath + filesUri)
89
- .replace('<body>', () => `<body>
89
+ .replace('<head>', () => `<head>
90
${!isFrontend ? '' : `
91
<title>${title.get()}</title>
92
<link rel="shortcut icon" href="${favicon.get() ? '/favicon.ico' : '#'}" />
@@ -108,6 +108,8 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
108
.replace(/<(\/script)/g, '<"+"$1') /*avoid breaking our script container*/}
109
document.documentElement.setAttribute('ver', '${VERSION.split('-')[0] /*for style selectors*/}')
110
</script>
111
+ `)
112
+ .replace('<body>', () => `<body>
113
<style>
114
:root {
115
${_.map(plugins, (configs, pluginName) =>