diff --git a/index.html b/index.html index 55cfd35ec0..256e031e63 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@ content="A series of tools for the Precious Plastic community to collaborate around the world. Connect, share and meet each other to tackle plastic waste." /> - + { - return ( - import.meta.env?.[property] || - process.env?.[property] || - fallbackValue || - '' - ) + return import.meta.env?.[property] || fallbackValue || '' } export const getConfigurationOption = _c diff --git a/src/pages/Howto/Content/HowtoList/HowtoList.tsx b/src/pages/Howto/Content/HowtoList/HowtoList.tsx index 40d5fe5acf..db00def7a6 100644 --- a/src/pages/Howto/Content/HowtoList/HowtoList.tsx +++ b/src/pages/Howto/Content/HowtoList/HowtoList.tsx @@ -19,7 +19,7 @@ import type { IHowto } from 'src/models' import type { HowtoSortOption } from './HowtoSortOptions' export const HowtoList = observer(() => { - const siteName = import.meta.env.VITE_SITE_NAME || process.env.VITE_SITE_NAME + const siteName = import.meta.env.VITE_SITE_NAME const { userStore } = useCommonStores().stores const [isFetching, setIsFetching] = useState(true) @@ -109,7 +109,7 @@ export const HowtoList = observer(() => { fontSize: 5, }} > - {process.env.VITE_HOWTOS_HEADING} + {import.meta.env.VITE_HOWTOS_HEADING} { - console.log({ - VITE_ACADEMY_RESOURCE: import.meta.env.VITE_ACADEMY_RESOURCE, - VITE_PROFILE_GUIDELINES_URL: import.meta.env.VITE_PROFILE_GUIDELINES_URL, - VITE_SITE_NAME: import.meta.env.VITE_SITE_NAME, - VITE_THEME: import.meta.env.VITE_THEME, - VITE_DONATIONS_BODY: import.meta.env.VITE_DONATIONS_BODY, - VITE_DONATIONS_IFRAME_SRC: import.meta.env.VITE_DONATIONS_IFRAME_SRC, - VITE_DONATIONS_IMAGE_URL: import.meta.env.VITE_DONATIONS_IMAGE_URL, - VITE_HOWTOS_HEADING: import.meta.env.VITE_HOWTOS_HEADING, - VITE_COMMUNITY_PROGRAM_URL: import.meta.env.VITE_COMMUNITY_PROGRAM_URL, - VITE_QUESTIONS_GUIDELINES_URL: import.meta.env - .VITE_QUESTIONS_GUIDELINES_URL, - VITE_BRANCH: import.meta.env.VITE_BRANCH, - VITE_CDN_URL: import.meta.env.VITE_CDN_URL, - VITE_FIREBASE_API_KEY: import.meta.env.VITE_FIREBASE_API_KEY, - VITE_FIREBASE_AUTH_DOMAIN: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN, - VITE_FIREBASE_DATABASE_URL: import.meta.env.VITE_FIREBASE_DATABASE_URL, - VITE_FIREBASE_MESSAGING_SENDER_ID: import.meta.env - .VITE_FIREBASE_MESSAGING_SENDER_ID, - VITE_FIREBASE_PROJECT_ID: import.meta.env.VITE_FIREBASE_PROJECT_ID, - VITE_FIREBASE_STORAGE_BUCKET: import.meta.env.VITE_FIREBASE_STORAGE_BUCKET, - VITE_SENTRY_DSN: import.meta.env.VITE_SENTRY_DSN, - VITE_GA_TRACKING_ID: import.meta.env.VITE_GA_TRACKING_ID, - VITE_PATREON_CLIENT_ID: import.meta.env.VITE_PATREON_CLIENT_ID, - VITE_PLATFORM_THEME: import.meta.env.VITE_PLATFORM_THEME, - VITE_PROJECT_VERSION: import.meta.env.VITE_PROJECT_VERSION, - VITE_SUPPORTED_MODULES: import.meta.env.VITE_SUPPORTED_MODULES, - }) switch (import.meta.env.VITE_THEME) { case 'project-kamp': return projectKampTheme @@ -118,6 +92,47 @@ const getEnvironmentTheme = () => { } } +export const links: LinksFunction = () => { + const theme = getEnvironmentTheme() + return [ + { + rel: 'icon', + href: theme.favicon, + type: 'image/x-icon', + }, + ] +} + +export const meta: MetaFunction = () => { + const theme = getEnvironmentTheme() + + return [ + { + title: theme.siteName, + }, + { + property: 'og:title', + content: theme.siteName, + }, + { + name: 'twitter:title', + content: theme.siteName, + }, + { + name: 'description', + content: theme.description, + }, + { + name: 'og:description', + content: theme.description, + }, + { + name: 'twitter:description', + content: theme.description, + }, + ] +} + export default function Root() { return (