admin/custom: new section "html head" #465

Massimo Melina committed Jan 31, 2024 at 15:38 UTC e1e10c2166cc53327285a60a787b8422289473ba
2 files changed +2 -1
src/customHtml.ts
+1 -1
@@ -8,7 +8,7 @@ import { mapPlugins } from './plugins'
8 const FILE = 'custom.html'
9
10 export const customHtmlSections: ReadonlyArray<string> = ['beforeHeader', 'afterHeader', 'afterMenuBar', 'afterList',
11 - 'top', 'bottom', 'afterEntryName', 'beforeLogin', 'unauthorized']
11 + 'top', 'bottom', 'afterEntryName', 'beforeLogin', 'unauthorized', 'htmlHead']
12
13 export const customHtmlState = proxy({
14 sections: watchLoadCustomHtml().state
src/serveGuiFiles.ts
+1
@@ -123,6 +123,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
123 `)
124 if (isFrontend)
125 ret = ret
126 + .replace('<head>', '<head>' + getSection('htmlHead'))
127 .replace('<body>', '<body>' + getSection('top'))
128 .replace('</body>', getSection('bottom') + '</body>')
129 return ret