mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-04-13 09:44:40 +00:00
feat: Allow injection of raw HTML strings inside <head>
This commit is contained in:
parent
965ba1ef76
commit
ce26d8d3cb
3 changed files with 15 additions and 0 deletions
|
@ -138,6 +138,10 @@ type Source = {
|
|||
};
|
||||
|
||||
websocketCompression?: boolean;
|
||||
|
||||
customHtml?: {
|
||||
head?: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type Config = {
|
||||
|
@ -257,6 +261,10 @@ export type Config = {
|
|||
};
|
||||
|
||||
websocketCompression?: boolean;
|
||||
|
||||
customHtml: {
|
||||
head: string;
|
||||
}
|
||||
};
|
||||
|
||||
export type FulltextSearchProvider = 'sqlLike' | 'sqlPgroonga' | 'meilisearch' | 'sqlTsvector';
|
||||
|
@ -406,6 +414,9 @@ export function loadConfig(): Config {
|
|||
maxAge: config.activityLogging?.maxAge ?? (1000 * 60 * 60 * 24 * 30),
|
||||
},
|
||||
websocketCompression: config.websocketCompression ?? false,
|
||||
customHtml: {
|
||||
head: config.customHtml?.head ?? '',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -558,4 +569,5 @@ function applyEnvOverrides(config: Source) {
|
|||
_apply_top([['signToActivityPubGet', 'checkActivityPubGetSignature', 'setupPassword']]);
|
||||
_apply_top(['logging', 'sql', ['disableQueryTruncation', 'enableQueryParamLogging']]);
|
||||
_apply_top(['activityLogging', ['enabled', 'preSave', 'maxAge']]);
|
||||
_apply_top(['customHtml', ['head']]);
|
||||
}
|
||||
|
|
|
@ -521,6 +521,7 @@ export class ClientServerService {
|
|||
url: this.config.url,
|
||||
title: this.meta.name ?? 'Sharkey',
|
||||
desc: this.meta.description,
|
||||
customHead: this.config.customHtml.head,
|
||||
...await this.generateCommonPugData(this.meta),
|
||||
...data,
|
||||
});
|
||||
|
|
|
@ -45,6 +45,8 @@ html
|
|||
link(rel='stylesheet' href=`/static-assets/fonts/sharkey-icons/style.css?version=${version}`)
|
||||
link(rel='modulepreload' href=`/vite/${entry.file}`)
|
||||
|
||||
| !{customHead}
|
||||
|
||||
if !config.frontendManifestExists
|
||||
script(type="module" src="/vite/@vite/client")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue