feat(site): per-gym SEO texts, event gym selector, hero/navbar polish
- Generated SEO titles/descriptions per gym; gym seo fields override each on its own - Keywords, author, og:site_name, favicon and JSON-LD logo follow the gym - CrossFit page 404s before output for gyms without a box - Events: «Mostrar em» gym selector; event page uses its gym's brand - Hero event button text colour from the event colour (--ev-on) - Navbar bottom line stops at the other-gym head (--switch-w) - Diagonal hero blur mask; remove the trial link
This commit is contained in:
1 parent
785d1f6ceb
commit
725f5b9c26
12 files changed
+93
-58
No files matched your search
+8
-4
@@ -105,8 +105,12 @@ $seo_desc = $event['summary'] !== ''
|
||||
: trim(mb_substr(strip_tags((string) ($event['subtitle'] ?: $event['description'])), 0, 200));
|
||||
|
||||
$current_uri_2 = 'evento';
|
||||
// An event tied to one gym (Eventos → «Mostrar em») renders in that gym's brand.
|
||||
$ev_gym = !empty($event['gym_id']) ? db_gyms_get($pdo, (int) $event['gym_id']) : null;
|
||||
if ($ev_gym && empty($_GET['gym'])) $_GET['gym'] = $ev_gym['slug'];
|
||||
$ev_gym = $ev_gym ?? site_gym($pdo) ?? gym_fallback();
|
||||
$GLOBALS['_page_meta_override'] = [
|
||||
($event['title'] !== '' ? $event['title'] : 'Evento') . ' | FitMe 3070',
|
||||
($event['title'] !== '' ? $event['title'] : 'Evento') . ' | ' . $ev_gym['name'],
|
||||
$seo_desc,
|
||||
];
|
||||
$GLOBALS['_canonical_override'] = $event_url;
|
||||
@@ -114,7 +118,7 @@ $GLOBALS['_og_type_override'] = 'article';
|
||||
if ($hero_url !== '') $GLOBALS['_og_image_override'] = $hero_url;
|
||||
|
||||
// Event structured data (schema.org/Event) for rich link previews / search.
|
||||
$info = site_info($pdo);
|
||||
$info = site_info($pdo, (int) $ev_gym['id']);
|
||||
$ld_event = [
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'Event',
|
||||
@@ -130,11 +134,11 @@ if (!empty($event['event_ends_at'])) $ld_event['endDate'] = str_replace(' ',
|
||||
$ld_event['location'] = $event['location'] !== ''
|
||||
? ['@type' => 'Place', 'name' => $event['location']]
|
||||
: ['@type' => 'Place',
|
||||
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070',
|
||||
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : $ev_gym['name'],
|
||||
'address' => $info['adress'] ?? ''];
|
||||
$ld_event['organizer'] = [
|
||||
'@type' => 'Organization',
|
||||
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : 'FitMe 3070',
|
||||
'name' => ($info['name'] ?? '') !== '' ? $info['name'] : $ev_gym['name'],
|
||||
'url' => base_url(),
|
||||
];
|
||||
$GLOBALS['_jsonld_extra'] = $ld_event;
|
||||
|
||||
Reference in new issue
Block a user