Private
Public Access
1
0

feat: use dynamic environment variable import

This commit is contained in:
2026-02-12 17:58:04 +01:00
parent 96e5d5718a
commit 92ab79bde8
2 changed files with 8 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ import type {
} from '$lib/types/data';
import type { ComponentKeys } from '$lib/types/strapi';
import type { Component } from 'svelte';
import { PUBLIC_STRAPI_URL } from '$env/static/public';
import { env as publicEnv } from '$env/dynamic/public';
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
export const cmsComponentMapping: Record<ComponentKeys, Promise<{ default: Component<any> }>> = {
@@ -32,7 +32,7 @@ export const mapHeaderData = (data: StrapiHomepageResponse): Header => {
const links: HeaderLink[] = data.data.components.map((component) => {
if (component.__component === 'shared.profile') {
return {
label: "Profile",
label: 'Profile',
href: `#${component.profile.anchor_id}`
};
} else if (component.__component === 'shared.project') {
@@ -72,7 +72,7 @@ const mapProfileData = (data: StrapiProfileComponent): Profile => {
title: data.profile.title,
anchorId: data.profile.anchor_id,
text: data.profile.description,
imageUrl: PUBLIC_STRAPI_URL + data.profile.image.formats.small.url
imageUrl: publicEnv.PUBLIC_STRAPI_URL + data.profile.image.formats.small.url
};
};