mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
🔄 Refactor domain image helper to return attributes array
🖼️ Update SEO data to use domain attributes instead of single image 🌐 Adjust meetup model and blade component to use new domain attributes function
This commit is contained in:
@@ -17,174 +17,277 @@ class SeoDataAttribute
|
||||
|
||||
private static function initDefinitions(): void
|
||||
{
|
||||
$domainImage = get_domain_image();
|
||||
$domainAttributes = get_domain_attributes();
|
||||
$domainImage = $domainAttributes['image'];
|
||||
$domainAuthor = $domainAttributes['author'];
|
||||
$domainTwitter = $domainAttributes['twitter'];
|
||||
$domainSiteName = __('Einundzwanzig Portal');
|
||||
|
||||
self::$seoDefinitions = [
|
||||
'login' => new SEOData(
|
||||
title: __('Login - Bitcoin Meetups'),
|
||||
description: __('Logge dich ein, um auf dein Bitcoin Meetup Konto zuzugreifen und an der Community teilzunehmen.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'dashboard' => new SEOData(
|
||||
title: __('Dashboard - Bitcoin Meetups'),
|
||||
description: __('Verwalte deine Bitcoin Meetups, Events und Einstellungen in deinem persönlichen Dashboard.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'welcome' => new SEOData(
|
||||
title: __('Willkommen bei Bitcoin Meetups'),
|
||||
description: __('Entdecke die Bitcoin Community in deiner Nähe. Finde lokale Meetups und vernetze dich mit Gleichgesinnten.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'follow_the_rabbit' => new SEOData(
|
||||
title: __('Follow the Rabbit - Bitcoin Journey'),
|
||||
description: __('Starte deine Bitcoin-Reise und entdecke spannende Inhalte rund um Bitcoin und Blockchain.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'cities_create' => new SEOData(
|
||||
title: __('Neue Stadt hinzufügen - Bitcoin Meetups'),
|
||||
description: __('Füge eine neue Stadt hinzu, um Bitcoin Meetups in deiner Region zu organisieren.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'cities_edit' => new SEOData(
|
||||
title: __('Stadt bearbeiten - Bitcoin Meetups'),
|
||||
description: __('Aktualisiere die Informationen für Bitcoin Meetup Standorte in deiner Stadt.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'cities_index' => new SEOData(
|
||||
title: __('Städteübersicht - Bitcoin Meetups'),
|
||||
description: __('Durchsuche alle Städte mit aktiven Bitcoin Meetups und finde Events in deiner Nähe.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'courses_create' => new SEOData(
|
||||
title: __('Neuen Kurs erstellen - Bitcoin Education'),
|
||||
description: __('Erstelle einen neuen Bitcoin-Bildungskurs und teile dein Wissen mit der Community.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'courses_edit_events' => new SEOData(
|
||||
title: __('Kursevents bearbeiten - Bitcoin Education'),
|
||||
description: __('Verwalte die Termine und Details deiner Bitcoin-Bildungsveranstaltungen.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'courses_edit' => new SEOData(
|
||||
title: __('Kurs bearbeiten - Bitcoin Education'),
|
||||
description: __('Aktualisiere die Inhalte und Informationen deines Bitcoin-Bildungskurses.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'courses_index' => new SEOData(
|
||||
title: __('Bitcoin Kurse - Übersicht'),
|
||||
description: __('Entdecke unsere vielfältigen Bitcoin-Bildungsangebote und Workshops.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'courses_landingpage' => new SEOData(
|
||||
title: __('Bitcoin Bildung & Kurse'),
|
||||
description: __('Lerne alles über Bitcoin - von den Grundlagen bis zu fortgeschrittenen Themen.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'lecturers_create' => new SEOData(
|
||||
title: __('Dozent werden - Bitcoin Education'),
|
||||
description: __('Werde Bitcoin-Dozent und teile dein Expertenwissen mit der Community.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'lecturers_edit' => new SEOData(
|
||||
title: __('Dozentenprofil bearbeiten'),
|
||||
description: __('Aktualisiere dein Profil als Bitcoin-Dozent und deine Kursangebote.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'lecturers_index' => new SEOData(
|
||||
title: __('Bitcoin Dozenten - Übersicht'),
|
||||
description: __('Lerne unsere erfahrenen Bitcoin-Dozenten und ihre Expertise kennen.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_create_edit_events' => new SEOData(
|
||||
title: __('Bitcoin Meetup Events verwalten'),
|
||||
description: __('Erstelle und bearbeite Bitcoin Meetup Events für deine Community.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_edit' => new SEOData(
|
||||
title: __('Meetup bearbeiten - Bitcoin Events'),
|
||||
description: __('Aktualisiere die Details und Informationen deines Bitcoin Meetups.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_index' => new SEOData(
|
||||
title: __('Bitcoin Meetups - Alle Events'),
|
||||
description: __('Finde alle aktuellen Bitcoin Meetups und Events in deiner Region.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_landingpage' => new SEOData(
|
||||
title: __('Bitcoin Meetups - Community Events'),
|
||||
description: __('Entdecke Bitcoin Community Events und vernetze dich mit Gleichgesinnten.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_landingpage_event' => new SEOData(
|
||||
title: __('Bitcoin Event Details'),
|
||||
description: __('Alle Informationen zum ausgewählten Bitcoin Meetup Event.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'meetups_map' => new SEOData(
|
||||
title: __('Bitcoin Meetups Karte'),
|
||||
description: __('Finde Bitcoin Meetups in deiner Nähe mit unserer interaktiven Karte.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'settings_appearance' => new SEOData(
|
||||
title: __('Erscheinungsbild - Einstellungen'),
|
||||
description: __('Passe das Erscheinungsbild deines Bitcoin Meetup Profils an.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'settings_delete_user_form' => new SEOData(
|
||||
title: __('Konto löschen - Bitcoin Meetups'),
|
||||
description: __('Informationen zum Löschen deines Bitcoin Meetup Kontos.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'settings_password' => new SEOData(
|
||||
title: __('Passwort ändern - Bitcoin Meetups'),
|
||||
description: __('Ändere dein Passwort für mehr Sicherheit deines Bitcoin Meetup Kontos.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'settings_profile' => new SEOData(
|
||||
title: __('Profil bearbeiten - Bitcoin Meetups'),
|
||||
description: __('Aktualisiere deine persönlichen Informationen und Profileinstellungen.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'venues_create' => new SEOData(
|
||||
title: __('Neuen Veranstaltungsort erstellen'),
|
||||
description: __('Füge einen neuen Ort für Bitcoin Meetups und Events hinzu.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'venues_edit' => new SEOData(
|
||||
title: __('Veranstaltungsort bearbeiten'),
|
||||
description: __('Aktualisiere die Details eines Bitcoin Meetup Veranstaltungsortes.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'venues_index' => new SEOData(
|
||||
title: __('Veranstaltungsorte - Übersicht'),
|
||||
description: __('Finde alle Veranstaltungsorte für Bitcoin Meetups und Events.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'services_create' => new SEOData(
|
||||
title: __('Neuen Service erstellen'),
|
||||
description: __('Füge einen neuen Self-Hosted Service zur Bitcoin Community hinzu.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'services_edit' => new SEOData(
|
||||
title: __('Service bearbeiten'),
|
||||
description: __('Aktualisiere die Details deines Self-Hosted Service.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'services_index' => new SEOData(
|
||||
title: __('Self-Hosted Services - Übersicht'),
|
||||
description: __('Entdecke Bitcoin Self-Hosted Services und dezentrale Angebote der Community.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
'services_landingpage' => new SEOData(
|
||||
title: __('Service Details'),
|
||||
description: __('Erfahre mehr über diesen Self-Hosted Service aus der Bitcoin Community.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
// Add more as needed
|
||||
'default' => new SEOData(
|
||||
title: __('Willkommen'),
|
||||
description: __('Toximalistisches Infotainment für bullische Bitcoiner.'),
|
||||
author: $domainAuthor,
|
||||
image: $domainImage,
|
||||
twitter_username: $domainTwitter,
|
||||
site_name: $domainSiteName,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ class Meetup extends Model implements HasMedia
|
||||
$this
|
||||
->addMediaCollection('logo')
|
||||
->singleFile()
|
||||
->useFallbackUrl(get_domain_image());
|
||||
->useFallbackUrl(get_domain_attributes()['image']);
|
||||
}
|
||||
|
||||
public function createdBy(): BelongsTo
|
||||
|
||||
@@ -14,8 +14,8 @@ if (!function_exists('route_with_country')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('get_domain_image')) {
|
||||
function get_domain_image(): string
|
||||
if (!function_exists('get_domain_attributes')) {
|
||||
function get_domain_attributes(): array
|
||||
{
|
||||
$langCountry = session('lang_country', 'de-DE');
|
||||
|
||||
@@ -39,11 +39,47 @@ if (!function_exists('get_domain_image')) {
|
||||
've-VE', // Venezuela
|
||||
];
|
||||
|
||||
$author = 'einundzwanzig';
|
||||
$image = asset('img/domains/'.$langCountry.'.jpg');
|
||||
// Use LAT image for South American countries
|
||||
if (in_array($langCountry, $southAmericanCountries, true)) {
|
||||
return asset('img/domains/lat.png');
|
||||
$image = asset('img/domains/lat.png');
|
||||
$author = 'veintiuno';
|
||||
$twitter = 'veintiunolat';
|
||||
}
|
||||
|
||||
return asset('img/domains/'.$langCountry.'.jpg');
|
||||
$countryAuthorMapping = [
|
||||
'de-DE' => 'einundzwanzig',
|
||||
'de-AT' => 'einundzwanzig',
|
||||
'de-CH' => 'einundzwanzig',
|
||||
'en-GB' => 'twenty-one',
|
||||
'en-US' => 'twenty-one',
|
||||
'es-ES' => 'veintiuno',
|
||||
'nl-NL' => 'eenentwintig',
|
||||
'pl-PL' => 'dwadzieścia',
|
||||
'hu-HU' => 'huszonegy',
|
||||
];
|
||||
|
||||
$countryTwitterMapping = [
|
||||
'de-DE' => '_einundzwanzig_',
|
||||
'de-AT' => '_einundzwanzig_',
|
||||
'de-CH' => '_einundzwanzig_',
|
||||
'en-GB' => '_einundzwanzig_',
|
||||
'en-US' => '_einundzwanzig_',
|
||||
'nl-NL' => '_Eenentwintig_',
|
||||
'pl-PL' => '21BitcoinPolska',
|
||||
'hu-HU' => 'HUSZONEGYworld',
|
||||
];
|
||||
|
||||
$author = $countryAuthorMapping[$langCountry] ?? 'einundzwanzig';
|
||||
$twitter = $countryTwitterMapping[$langCountry] ?? '_einundzwanzig_';
|
||||
$siteName = $countrySiteNameMapping[$langCountry] ?? 'Einundzwanzig Portal';
|
||||
|
||||
return [
|
||||
'image' => $image,
|
||||
'author' => $author,
|
||||
'twitter' => $twitter,
|
||||
'siteName' => $siteName,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
</g>
|
||||
</svg>
|
||||
@else
|
||||
<img src="{{ get_domain_image() }}" alt="{{ session('lang_country', 'de-DE') }}">
|
||||
<img src="{{ get_domain_attributes()['image'] }}" alt="{{ session('lang_country', 'de-DE') }}">
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user