From 0b59b3b977afa3533ee17fd7cab99afa29656523 Mon Sep 17 00:00:00 2001 From: becarta Date: Fri, 18 Jul 2025 08:16:10 +0200 Subject: [PATCH] Update server configuration and translations for improved deployment and user experience - Enhanced server startup message to include dynamic protocol and domain based on the environment (production or development). - Updated translation references from GitHub to Gitea across multiple languages for consistency. - Refactored layout and metadata in Astro components to utilize SITE configuration for URLs, ensuring accurate site links. - Cleaned up unused code in the layout file and removed commented-out sections for better readability. --- server.js | 9 ++++++++- src/i18n/translations.journii.ts | 8 ++++---- src/layouts/Layout.astro | 13 ++++++------- src/pages/[lang]/aboutme.astro | 5 +++-- src/pages/[lang]/journii.astro | 18 +++++------------- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/server.js b/server.js index 9ee4a68..85de813 100644 --- a/server.js +++ b/server.js @@ -18,5 +18,12 @@ app.use(express.static(path.join(__dirname, 'dist/client'))); app.all('*', handler); app.listen(PORT, () => { - console.log(`Server running with compression on http://localhost:${PORT}`); + const isProduction = process.env.NODE_ENV === 'production'; + const domain = isProduction ? '365devnet.eu' : `localhost:${PORT}`; + const protocol = isProduction ? 'https' : 'http'; + + console.log(`Server running with compression on ${protocol}://${domain}`); + if (!isProduction) { + console.log(`Development server accessible at http://localhost:${PORT}`); + } }); \ No newline at end of file diff --git a/src/i18n/translations.journii.ts b/src/i18n/translations.journii.ts index 9678ae8..a30d9a3 100644 --- a/src/i18n/translations.journii.ts +++ b/src/i18n/translations.journii.ts @@ -143,7 +143,7 @@ const translations: Record = { cta: { title: "Stay Updated", desc: "Journii is currently in active development. Follow our progress and be among the first to know when it launches.", - github: "View on GitHub", + github: "View on Gitea", updates: "Get Updates" } }, @@ -225,7 +225,7 @@ const translations: Record = { cta: { title: "Blijf op de Hoogte", desc: "Journii is momenteel in actieve ontwikkeling. Volg onze voortgang en wees een van de eersten die het weet wanneer het wordt gelanceerd.", - github: "Bekijk op GitHub", + github: "Bekijk op Gitea", updates: "Ontvang Updates" } }, @@ -307,7 +307,7 @@ const translations: Record = { cta: { title: "Bleiben Sie Auf Dem Laufenden", desc: "Journii befindet sich derzeit in aktiver Entwicklung. Verfolgen Sie unseren Fortschritt und gehören Sie zu den Ersten, die erfahren, wann es startet.", - github: "Auf GitHub Ansehen", + github: "Auf Gitea Ansehen", updates: "Updates Erhalten" } }, @@ -389,7 +389,7 @@ const translations: Record = { cta: { title: "Restez Informé", desc: "Journii est actuellement en développement actif. Suivez nos progrès et soyez parmi les premiers à savoir quand il sera lancé.", - github: "Voir sur GitHub", + github: "Voir sur Gitea", updates: "Recevoir les Mises à Jour" } } diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 8de0a6a..96195ea 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,7 +1,7 @@ --- import '~/assets/styles/tailwind.css'; -import { I18N } from 'astrowind:config'; +import { I18N, SITE } from 'astrowind:config'; import CommonMeta from '~/components/common/CommonMeta.astro'; import Favicons from '~/components/Favicons.astro'; @@ -52,10 +52,10 @@ const { language, textDirection } = I18N; '@context': 'https://schema.org', '@type': 'WebSite', name: '365DevNet', - url: Astro.url.origin, + url: SITE.site, potentialAction: { '@type': 'SearchAction', - target: `${Astro.url.origin}/search?q={search_term_string}`, + target: `${SITE.site}/search?q={search_term_string}`, 'query-input': 'required name=search_term_string', }, }} @@ -84,8 +84,8 @@ const { language, textDirection } = I18N; - - - + diff --git a/src/pages/[lang]/aboutme.astro b/src/pages/[lang]/aboutme.astro index 7d93ace..b539863 100644 --- a/src/pages/[lang]/aboutme.astro +++ b/src/pages/[lang]/aboutme.astro @@ -12,6 +12,7 @@ import CallToAction from '~/components/widgets/CallToAction.astro'; import HomePageImage from '~/assets/images/richardbergsma.png'; import { getTranslation, supportedLanguages } from '~/i18n/translations'; +import { SITE } from 'astrowind:config'; export async function getStaticPaths() { return supportedLanguages.map((lang) => ({ @@ -385,8 +386,8 @@ const metadata = { name: 'Richard Bergsma', jobTitle: 'IT Systems and Automation Manager', description: t.hero.subtitle, - image: Astro.url.origin + '/images/richardbergsma.png', - url: Astro.url.origin, + image: SITE.site + '/images/richardbergsma.png', + url: SITE.site, sameAs: ['https://www.linkedin.com/in/rrpbergsma', 'https://github.com/rrpbergsma'], knowsAbout: t.skills.items.map((skill) => skill.title), worksFor: { diff --git a/src/pages/[lang]/journii.astro b/src/pages/[lang]/journii.astro index 49b331d..36217aa 100644 --- a/src/pages/[lang]/journii.astro +++ b/src/pages/[lang]/journii.astro @@ -174,25 +174,17 @@ const metadata = {