Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • software/fchh-website-content
  • TarikZiyad/fchh-website-content
  • kosai_14/fchh-website-content
3 results
Show changes
Commits on Source (4)
Showing
with 259 additions and 7 deletions
image: node:alpine image: node:18-alpine
variables: variables:
TEMPLATE_DOWNLOAD_URL: https://gitlab.fabcity.hamburg/fcos-suite/fcos-suite-astro/-/archive/main/fcos-suite-astro-main.zip TEMPLATE_DOWNLOAD_URL: https://gitlab.fabcity.hamburg/fcos-suite/fcos-suite-astro/-/archive/main/fcos-suite-astro-main.zip
......
...@@ -29,7 +29,27 @@ const mapCollection = defineCollection({ ...@@ -29,7 +29,27 @@ const mapCollection = defineCollection({
}), }),
}); });
const socialsCollection = defineCollection({
schema: z.object({
alt: z.string(),
type: z.string(),
href: z.string(),
}),
});
const toolbarCollection = defineCollection({
schema: z.object({
title: z.string(),
icon: z.string(),
target: z.string(),
onlyDesktop: z.boolean().optional(),
order: z.number()
}),
});
export const collections = { export const collections = {
people: peopleCollection, people: peopleCollection,
map: mapCollection, map: mapCollection,
socials: socialsCollection,
toolbar: toolbarCollection,
}; };
---
alt: Facebook
type: facebook
href: "https://www.facebook.com/fabcityhamburg/"
---
---
alt: GitLab
type: gitlab
href: "https://gitlab.fabcity.hamburg"
---
---
alt: Instagram
type: instagram
href: "https://www.instagram.com/fabcityhh/"
---
---
alt: LinkedIn
type: linkedin
href: "https://www.linkedin.com/company/fab-city-hamburg/"
---
---
alt: Mastodon
type: mastodon
href: "https://mastodon.social/@fabcityhamburg"
---
---
alt: Twitter
type: twitter
href: "https://twitter.com/fabcityhamburg"
---
\ No newline at end of file
---
alt: "Youtube"
type: "youtube"
href: "https://www.youtube.com/c/FabCityHamburg"
---
---
order: 3
title: Community
icon: Chat
target: /de/network/community
---
---
order: 4
title: Events
icon: Calendar
target: /de/network/events
---
---
order: 2
title: Hub
icon: Folders
target: /de/projects/knowledgehub/
onlyDesktop: true
---
---
order: 1
title: Map
icon: ChoroplethMap
target: /de/network/map
---
---
order: 5
title: OS
icon: ApplicationVirtual
target: /de/projects/fcos
---
...@@ -7,7 +7,6 @@ headerImage: images/home/nasa-Q1p7bh3SHj8-unsplash_fchh.jpg ...@@ -7,7 +7,6 @@ headerImage: images/home/nasa-Q1p7bh3SHj8-unsplash_fchh.jpg
headerImageAlt: test hero image headerImageAlt: test hero image
hidden: true hidden: true
hideFooterSeparator: true hideFooterSeparator: true
translated: de/contact
--- ---
<People names={["axel", "jenny", "manuel", "tobias"]} /> <People names={["axel", "jenny", "manuel", "tobias"]} />
......
...@@ -5,7 +5,6 @@ subtitle: Who's behind all this? ...@@ -5,7 +5,6 @@ subtitle: Who's behind all this?
headerImage: images/fchh/association/fchh-logopattern-hero.png headerImage: images/fchh/association/fchh-logopattern-hero.png
headerImageAlt: The FCHH logo as a repeated pattern headerImageAlt: The FCHH logo as a repeated pattern
hidden: true hidden: true
translated: de/legal
--- ---
## Information according to § 5 TMG ## Information according to § 5 TMG
......
--- ---
layout: "@layouts/ArticleLayout.astro" layout: "@layouts/ArticleLayout.astro"
title: ​ Data protection title: Privacy
subtitle: What happens with my data? subtitle: What happens with my data?
headerImage: images/fchh/association/fchh-logopattern-hero.png headerImage: images/fchh/association/fchh-logopattern-hero.png
headerImageAlt: Picture of two metal palm trees headerImageAlt: Picture of two metal palm trees
...@@ -18,7 +18,7 @@ Hermann-Blohm-Strasse 3 ...@@ -18,7 +18,7 @@ Hermann-Blohm-Strasse 3
Authorized representative: Dr. Tobias Redlich (for the Helmut Schmidt University/University of the Federal Armed Forces) Authorized representative: Dr. Tobias Redlich (for the Helmut Schmidt University/University of the Federal Armed Forces)
## Contact: ## Contact:
Email: info@fabcity.hamburg Email: info@fabcity.hamburg
You can reach our temporary data protection officer, Werner Jarmatz, at: datenschutz(ätt)fabcity.hamburg You can reach our temporary data protection officer, Werner Jarmatz, at: datenschutz(ätt)fabcity.hamburg
...@@ -26,9 +26,9 @@ You can reach our temporary data protection officer, Werner Jarmatz, at: datensc ...@@ -26,9 +26,9 @@ You can reach our temporary data protection officer, Werner Jarmatz, at: datensc
## What personal data is processed for what purpose and what is the legal basis for this? ## What personal data is processed for what purpose and what is the legal basis for this?
When you visit our website, we collect statistical data using the web statistics software Umami , which we host ourselves. The data remain on our server and are completely anonymized and do not allow any conclusions to be drawn about individual visitors. When you visit our website, we collect statistical data using the web statistics software Umami , which we host ourselves. The data remain on our server and are completely anonymized and do not allow any conclusions to be drawn about individual visitors.
## What other recipients are there? ## What other recipients are there?
### When visiting the site ### When visiting the site
When you visit this website, certain technical information (IP address of the requesting computer, date and time of access, name and URL of the file accessed, website from which access is made (referrer URL), browser used and, if applicable, the operating system of your computer, status code and amount of data transferred ) is transferred to our webhosting service provider Netcup and stored there in the form of server log files. The log files are automatically deleted after 14 days. When you visit this website, certain technical information (IP address of the requesting computer, date and time of access, name and URL of the file accessed, website from which access is made (referrer URL), browser used and, if applicable, the operating system of your computer, status code and amount of data transferred ) is transferred to our webhosting service provider Netcup and stored there in the form of server log files. The log files are automatically deleted after 14 days.
......
import { DEFAULT_LOCALE } from "@config";
import { partitionBy } from "@utils";
import type { IPage } from "@interfaces/IPage";
import { MDXInstance } from "astro";
const storageKey = "preferredLanguage";
/**
* This function will look for an existing language preference in
* localStorage. If there is none, it will guess prefered language
* from Browser settings. If this doesn't work it will use a default
* value.
*/
export const getOrGuessInitialLanguageFromBrowser = () => {
let preferredLanguage = localStorage.getItem(storageKey)?.toLowerCase();
if (!preferredLanguage) {
if (/^en\b/.test(navigator.language.toLowerCase())) {
preferredLanguage = "en";
} else {
// Use German as default for unknown language browser settings
preferredLanguage = DEFAULT_LOCALE;
}
localStorage.setItem(storageKey, preferredLanguage);
}
return preferredLanguage;
};
export const setLanguage = (newLanguage: string) => {
localStorage.setItem(storageKey, newLanguage);
};
export const getLanguage = () => {
return localStorage.getItem(storageKey);
};
export const buildTranslationRoutes = (
allPages: MDXInstance<IPage>[],
baseUrl,
allLocales
) => {
// Split pages in two, just by the existence of a `translated` frontmatter property
const [translatedPages, unTranslatedPages] = partitionBy(allPages, (page) =>
Boolean(page.frontmatter?.translated)
);
// The pages w/o the frontmatter property can still be the "translation targets"
// of another page that has the `translated` property
const unTranslatedAndNoTargetPages = unTranslatedPages.filter(
(untranslatedPage) =>
!translatedPages.some((translatedPage) =>
untranslatedPage.url.includes(translatedPage.frontmatter.translated)
)
);
const translatedRoutes = translatedPages
.flatMap((translatedPage) =>
buildTranslatedRoutesFromPage(translatedPage, baseUrl, allLocales)
)
.filter(Boolean);
const fallbackRoutes = unTranslatedAndNoTargetPages
.flatMap((untranslatedPage) =>
buildFallbackRouteForPage(untranslatedPage, baseUrl, allLocales)
)
.filter(Boolean);
return [...translatedRoutes, ...fallbackRoutes];
};
/**
* Build a fallback route for a given page (this is a route that redirects to the home page, e.g. if no translated content is available)
*/
const buildFallbackRouteForPage = (
page: MDXInstance<IPage>,
baseUrl: string,
allLocales: string[],
targetOverride?: string
) => {
const urlPartsWithoutBase = page?.url
?.replace(baseUrl, "")
.split("/")
.filter(Boolean);
if (urlPartsWithoutBase && urlPartsWithoutBase.length > 0) {
const localeFromUrl = urlPartsWithoutBase && urlPartsWithoutBase[0];
const otherLocale = allLocales.filter(
(locale) => locale !== localeFromUrl
)[0];
const middleParts = urlPartsWithoutBase?.slice(1, -1);
const slugFromUrl = urlPartsWithoutBase.at(-1);
const firstRedirect = {
from: `${otherLocale}${
Boolean(middleParts.length) ? `/${middleParts?.join("/")}` : ""
}/${slugFromUrl}`,
to: targetOverride || "/",
};
return [
{
params: {
slug: firstRedirect.from,
},
props: {
newTarget: firstRedirect.to,
},
},
];
}
};
/**
* Build translated routes for a given page. This results in two routes (back and forth)
*/
const buildTranslatedRoutesFromPage = (
page: MDXInstance<IPage>,
baseUrl: string,
allLocales: string[]
) => {
const urlPartsWithoutBase = page?.url
?.replace(baseUrl, "")
.split("/")
.filter(Boolean);
if (urlPartsWithoutBase && urlPartsWithoutBase.length > 0) {
const localeFromUrl = urlPartsWithoutBase && urlPartsWithoutBase[0];
const otherLocale = allLocales.filter(
(locale) => locale !== localeFromUrl
)[0];
const middleParts = urlPartsWithoutBase?.slice(1, -1);
const slugFromUrl = urlPartsWithoutBase.at(-1);
const otherSlugWithoutLocale = page.frontmatter?.translated
?.split("/")
.filter(Boolean)
.slice(1)
.join("/");
if (otherSlugWithoutLocale) {
const firstRedirect = {
from: `${localeFromUrl}/${otherSlugWithoutLocale}`,
to: page.url,
};
const secondRedirect = {
from: `${otherLocale}${
Boolean(middleParts.length) ? `/${middleParts?.join("/")}` : ""
}/${slugFromUrl}`,
to: `${baseUrl}/${otherLocale}/${otherSlugWithoutLocale}`,
};
return [
{
params: {
slug: firstRedirect.from,
},
props: {
newTarget: firstRedirect.to,
},
},
{
params: {
slug: secondRedirect.from,
},
props: { newTarget: secondRedirect.to },
},
];
}
}
};