diff --git a/kubernetes/loculus/templates/_common-metadata.tpl b/kubernetes/loculus/templates/_common-metadata.tpl index a58e1fe5c5..1cbd872d5f 100644 --- a/kubernetes/loculus/templates/_common-metadata.tpl +++ b/kubernetes/loculus/templates/_common-metadata.tpl @@ -31,6 +31,7 @@ fields: {{/* Generate website config from passed config object */}} {{- define "loculus.generateWebsiteConfig" }} name: {{ $.Values.name }} +logo: {{ $.Values.logo | toYaml | nindent 6 }} accessionPrefix: {{ $.Values.accessionPrefix }} {{- $commonMetadata := (include "loculus.commonMetadata" . | fromYaml).fields }} instances: diff --git a/kubernetes/loculus/values.yaml b/kubernetes/loculus/values.yaml index d322d9323d..e3971a36dc 100644 --- a/kubernetes/loculus/values.yaml +++ b/kubernetes/loculus/values.yaml @@ -5,6 +5,10 @@ disablePreprocessing: false siloImportLimitSeconds: 3600 accessionPrefix: "LOC_" name: "Loculus" +logo: + url: "/favicon.svg" + width: 100 + height: 100 instances: dummy-organism: schema: diff --git a/website/src/config.ts b/website/src/config.ts index c65d7740e7..cbba810896 100644 --- a/website/src/config.ts +++ b/website/src/config.ts @@ -18,7 +18,7 @@ function getConfigDir(): string { return configDir; } -function getWebsiteConfig(): WebsiteConfig { +export function getWebsiteConfig(): WebsiteConfig { if (_config === null) { _config = readTypedConfigFile('website_config.json', websiteConfig); } diff --git a/website/src/layouts/BaseLayout.astro b/website/src/layouts/BaseLayout.astro index 531aa838f5..5d7574260b 100644 --- a/website/src/layouts/BaseLayout.astro +++ b/website/src/layouts/BaseLayout.astro @@ -2,7 +2,10 @@ import '../styles/base.scss'; import Navigation from '../components/Navigation/Navigation.astro'; import OrganismSelector from '../components/Navigation/OrganismSelector.astro'; +import { getWebsiteConfig } from '../config'; import { navigationItems } from '../routes'; +const websiteConfig = getWebsiteConfig(); +const { name: websiteName, logo } = websiteConfig; interface Props { title: string; @@ -26,8 +29,17 @@ const { title } = Astro.props;
diff --git a/website/src/types/config.ts b/website/src/types/config.ts index 6048380d59..06a8d3b939 100644 --- a/website/src/types/config.ts +++ b/website/src/types/config.ts @@ -41,7 +41,15 @@ export const instanceConfig = z.object({ }); export type InstanceConfig = z.infer; +const logoConfig = z.object({ + url: z.string(), + width: z.number(), + height: z.number(), +}); + export const websiteConfig = z.object({ instances: z.record(instanceConfig), + name: z.string(), + logo: logoConfig, }); export type WebsiteConfig = z.infer; diff --git a/website/src/types/runtimeConfig.ts b/website/src/types/runtimeConfig.ts index a3b8f789c9..ce74afec98 100644 --- a/website/src/types/runtimeConfig.ts +++ b/website/src/types/runtimeConfig.ts @@ -1,5 +1,7 @@ import { z } from 'zod'; +export const name = z.string().min(1); + const serviceUrls = z.object({ backendUrl: z.string(), lapisUrls: z.record(z.string(), z.string()),