119 lines
7.1 KiB
PHP
119 lines
7.1 KiB
PHP
<?php
|
||
// Per-page metadata, keyed by $current_uri_2. The canonical URL comes from
|
||
// base_url(), which matches the https + non-www redirect in .htaccess.
|
||
$page = $current_uri_2 ?? '';
|
||
$page_meta = [
|
||
'' => ['FitMe 3070 — Ginásio & CrossFit em Mira',
|
||
'Ginásio em Mira (Lagoa) com musculação, CrossFit, aulas de grupo, personal trainers, nutrição e fisioterapia. Inscreve-te já no FitMe 3070!'],
|
||
'crossfit' => ['CrossFit 3070 — Box de CrossFit em Mira | FitMe 3070',
|
||
'Box de CrossFit em Mira (Lagoa). Aulas para todos os níveis com treinadores certificados. Marca a tua aula experimental no CrossFit 3070!'],
|
||
'privacidade' => ['Política de Privacidade | FitMe 3070',
|
||
'Política de privacidade do FitMe 3070 — como recolhemos, usamos e protegemos os teus dados pessoais.'],
|
||
'termos' => ['Termos e Condições | FitMe 3070',
|
||
'Termos e condições de utilização do website do FitMe 3070.'],
|
||
];
|
||
// The gym's homepage uses the gym's own SEO title/description when set
|
||
// (Gestão → Ginásios); a new gym without them gets a generic one from its name
|
||
// and locality rather than the 3070 texts above.
|
||
$gym_meta = current_gym();
|
||
if ($page === '' && ($gym_meta['seo_title'] ?? '') !== '') {
|
||
$page_meta[''] = [$gym_meta['seo_title'], ($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : $page_meta[''][1]];
|
||
} elseif ($page === '' && (int) $gym_meta['id'] !== 1) {
|
||
$loc = ($gym_meta['locality'] ?? '') !== '' ? ' em ' . $gym_meta['locality'] : '';
|
||
$page_meta[''] = [$gym_meta['name'] . ' — Ginásio' . $loc,
|
||
($gym_meta['seo_description'] ?? '') !== '' ? $gym_meta['seo_description'] : 'Ginásio ' . $gym_meta['name'] . $loc . ': treino, aulas de grupo e acompanhamento.'];
|
||
}
|
||
// A dynamic page (e.g. an event landing page) can set its own title/description
|
||
// and canonical via these globals before requiring _open.php.
|
||
[$page_title, $page_desc] = $GLOBALS['_page_meta_override'] ?? $page_meta[$page] ?? $page_meta[''];
|
||
$canonical = $GLOBALS['_canonical_override'] ?? match ($page) {
|
||
'' => gym_url($gym_meta),
|
||
'crossfit' => gym_url($gym_meta, 'crossfit'),
|
||
default => base_url('home/' . $page),
|
||
};
|
||
?><!doctype html>
|
||
<html lang="pt">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||
<meta name="description" content="<?= htmlspecialchars($page_desc) ?>">
|
||
<meta name="keywords" content="fitness, ginásio, exercício, personal trainer, crossfit, box, aveiro, mira">
|
||
<meta name="author" content="FitMe 3070">
|
||
<meta name="theme-color" content="<?= htmlspecialchars(($gym_meta['brand_color'] ?? '') !== '' ? $gym_meta['brand_color'] : '#C2D500') ?>">
|
||
<title><?= htmlspecialchars($page_title) ?></title>
|
||
<link rel="canonical" href="<?= htmlspecialchars($canonical) ?>">
|
||
<?php if (seo_noindex()): /* staging copies (e.g. fitme.andmore.pt) must not compete with the real domain */ ?>
|
||
<meta name="robots" content="noindex, nofollow">
|
||
<?php endif; ?>
|
||
|
||
<!-- Preconnect to external origins -->
|
||
<link rel="dns-prefetch" href="https://forms.zohopublic.eu">
|
||
<?php if (($current_uri_2 ?? '') === ''): ?>
|
||
<!-- Homepage hero is the LCP image — start fetching it before the CSS/JS -->
|
||
<?php $pre_hero = ($gym_meta['hero_image'] ?? '') !== '' ? $gym_meta['hero_image'] : 'site/assets/img/home.jpg';
|
||
// A .jxl hero (img_css_bg) is preloaded only where JXL is supported (type=); the rest fetch the fallback from the CSS. ?>
|
||
<link rel="preload" as="image" fetchpriority="high" href="<?= htmlspecialchars(base_url($pre_hero)) ?>"<?= img_fallback_rel($pre_hero) !== '' ? ' type="image/jxl"' : '' ?>>
|
||
<?php endif; ?>
|
||
|
||
<!-- Fonts (Roboto self-hosted — see @font-face in style.css) -->
|
||
|
||
<!-- Vendor: Bootstrap 5.3.3 -->
|
||
<?= link_tag('assets/vendor/bootstrap5/css/bootstrap.min.css') ?>
|
||
|
||
<!-- Icons: Font Awesome 6 from the shared platform-tools pack (local FA 5.13.1 as fallback) -->
|
||
<?= fit_icon_assets(['fontawesome'], ['site/assets/fonts/fontawesome/css/all.css']) ?>
|
||
|
||
|
||
<!-- App styles (Bootstrap overrides) -->
|
||
<?= link_tag('site/assets/css/style.css') ?>
|
||
|
||
<!-- Favicon -->
|
||
<link rel="icon" type="image/svg+xml" href="<?= base_url('site/assets/img/logos/logo_black.svg') ?>">
|
||
<link rel="apple-touch-icon" sizes="180x180" href="<?= base_url('site/assets/img/logos/apple-touch-icon.png') ?>">
|
||
|
||
<!-- Open Graph / link previews -->
|
||
<meta property="og:url" content="<?= htmlspecialchars($canonical) ?>">
|
||
<meta property="og:type" content="<?= htmlspecialchars($GLOBALS['_og_type_override'] ?? 'website') ?>">
|
||
<meta property="og:site_name" content="FitMe 3070">
|
||
<meta property="og:locale" content="pt_PT">
|
||
<meta property="og:title" content="<?= htmlspecialchars($page_title) ?>">
|
||
<meta property="og:description" content="<?= htmlspecialchars($page_desc) ?>">
|
||
<meta property="og:image" content="<?= htmlspecialchars($GLOBALS['_og_image_override'] ?? base_url('site/assets/img/og-image.jpg')) ?>">
|
||
<?php if (empty($GLOBALS['_og_image_override'])): /* default banner is a known 1200×630; a per-page image isn't, so skip the dimension hints */ ?>
|
||
<meta property="og:image:width" content="1200">
|
||
<meta property="og:image:height" content="630">
|
||
<?php endif; ?>
|
||
<meta name="twitter:card" content="summary_large_image">
|
||
|
||
<!-- Structured data -->
|
||
<?= view('seo') ?>
|
||
<?php if (($brand_css = gym_brand_css($gym_meta)) !== ''): ?><style><?= $brand_css ?></style><?php endif; ?>
|
||
<?php include dirname(__DIR__, 2) . '/includes/env_ribbon.php'; // moldura de aviso fora de produção ?>
|
||
</head>
|
||
<body>
|
||
<svg width="0" height="0" style="position:absolute" aria-hidden="true" focusable="false">
|
||
<!-- Grain for the h1/h2 lettering (style.css, "Noise texture"): fractal noise -> grey ->
|
||
squeezed to 88-100% brightness, multiplied into the glyphs and clipped to their shape. -->
|
||
<filter id="pt-noise" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">
|
||
<feTurbulence type="fractalNoise" baseFrequency="1.98" numOctaves="1" seed="7" result="n"/>
|
||
<feColorMatrix in="n" type="saturate" values="0" result="g"/>
|
||
<feComponentTransfer in="g" result="grain">
|
||
<feFuncR type="linear" slope=".123" intercept=".877"/>
|
||
<feFuncG type="linear" slope=".123" intercept=".877"/>
|
||
<feFuncB type="linear" slope=".123" intercept=".877"/>
|
||
<feFuncA type="linear" slope="0" intercept="1"/>
|
||
</feComponentTransfer>
|
||
<feBlend in="SourceGraphic" in2="grain" mode="multiply" result="mix"/>
|
||
<feComposite in="mix" in2="SourceGraphic" operator="in"/>
|
||
</filter>
|
||
<!-- Liquid glass for the navbar backdrop (style.css .header-section, Chromium):
|
||
soft low-frequency noise, blurred so it has no grain, drives a displacement
|
||
that bends the page behind the bar like uneven glass. -->
|
||
<filter id="nav-glass" x="0" y="0" width="100%" height="100%" color-interpolation-filters="sRGB">
|
||
<feTurbulence type="fractalNoise" baseFrequency=".008 .04" numOctaves="2" seed="3" result="t"/>
|
||
<feGaussianBlur in="t" stdDeviation="2" result="map"/>
|
||
<feDisplacementMap in="SourceGraphic" in2="map" scale="38" xChannelSelector="R" yChannelSelector="G"/>
|
||
</filter>
|
||
</svg>
|
||
<a href="#conteudo" class="skip-link">Saltar para o conteúdo</a>
|