diff --git a/src/assets/favicons/apple-touch-icon.png b/src/assets/favicons/apple-touch-icon.png deleted file mode 100644 index 6262d06..0000000 Binary files a/src/assets/favicons/apple-touch-icon.png and /dev/null differ diff --git a/src/assets/favicons/favicon.ico b/src/assets/favicons/favicon.ico deleted file mode 100644 index 9f9502a..0000000 Binary files a/src/assets/favicons/favicon.ico and /dev/null differ diff --git a/src/assets/images/posts/Nexthink.webp b/src/assets/images/posts/Nexthink.webp deleted file mode 100644 index 1f124dd..0000000 Binary files a/src/assets/images/posts/Nexthink.webp and /dev/null differ diff --git a/src/components/LanguageSelector.astro b/src/components/LanguageSelector.astro new file mode 100644 index 0000000..3dee957 --- /dev/null +++ b/src/components/LanguageSelector.astro @@ -0,0 +1,37 @@ +--- +// Define your supported languages +const languages = [ + { code: 'en', label: 'English' }, + { code: 'fr', label: 'Français' }, + { code: 'es', label: 'Español' }, +]; + +// Determine the current language from the URL for setting the selected option. +const pathSegments = window.location.pathname.split('/').filter(Boolean); +const currentLang = pathSegments[0] || 'en'; +--- + + + \ No newline at end of file diff --git a/src/components/widgets/Header.astro b/src/components/widgets/Header.astro index ff4a3aa..4ec78eb 100644 --- a/src/components/widgets/Header.astro +++ b/src/components/widgets/Header.astro @@ -5,6 +5,7 @@ import ToggleTheme from '~/components/common/ToggleTheme.astro'; import ToggleMenu from '~/components/common/ToggleMenu.astro'; import Button from '~/components/ui/Button.astro'; + import { getHomePermalink } from '~/utils/permalinks'; import { trimSlash, getAsset } from '~/utils/permalinks'; import type { CallToAction } from '~/types'; @@ -45,6 +46,36 @@ const { } = Astro.props; const currentPath = `/${trimSlash(new URL(Astro.url).pathname)}`; + +// Define the available languages. +const languages = [ + { code: 'en', label: 'English' }, + { code: 'nl', label: 'Nederlands' }, + { code: 'de', label: 'Deutsch' }, +]; + +// Get the current URL segments. +const pathSegments = new URL(Astro.url).pathname.split('/').filter(Boolean); +const currentLang = pathSegments[0] || 'en'; + +// When the user selects a new language, update the URL accordingly. +// This function assumes your pages are structured as //page... +function handleLanguageChange(event: Event) { + const select = event.target as HTMLSelectElement; + const selectedLang = select.value; + const newSegments = [...pathSegments]; + + // Replace the first segment if it matches a known language code; otherwise, add it. + if (['en', 'nl', 'de'].includes(newSegments[0])) { + newSegments[0] = selectedLang; + } else { + newSegments.unshift(selectedLang); + } + + const newPath = '/' + newSegments.join('/'); + window.location.href = newPath; +} + ---
- { - actions?.length ? ( - - {actions.map((btnProps) => ( -