Auditoria: "Site público em Bootstrap 4.3.1 (EOL); backoffice em
5.3.3" — o backoffice já usa a 5.3.3 vendorizada (assets/vendor/bootstrap5/),
o site público passa a usar a mesma cópia em vez da 4.3.1.
Levantamento antes de mexer: a folha de estilo própria (style.css)
quase não usa classes utilitárias cruas do Bootstrap (grep confirma
zero ml-/mr-/pl-/pr-/float-left/float-right/custom-select/
custom-control/badge-/sr-only/font-weight-/text-left/text-right —
tudo classes próprias como .site-btn). O que precisava de mudar:
- CSS/JS: assets/vendor/bootstrap/ -> assets/vendor/bootstrap5/
(bundle, inclui Popper).
- Os 7 atributos data-toggle/data-target/data-dismiss (BS4) ->
data-bs-toggle/data-bs-target/data-bs-dismiss (BS5): toggle da nav
mobile, os dois modais (aula experimental, inscrição), o botão de
fechar do alerta. O seletor em main.js que lê data-target também
mudou para não parar de encontrar os botões.
- .close -> .btn-close (BS5 renomeou o componente; markup sem o
× interno, que o BS5 desenha via CSS).
- .form-row -> .row (BS4 tinha form-row com gutters menores; BS5 não
tem, style.css não tinha overrides para form-row, confirmado).
- O apanhado maior: dois <script> inline chamavam
jQuery('#trialModal').modal('show') ao estilo de plugin jQuery do
BS4 (para reabrir o modal depois de um erro de submissão) — o BS5
não regista plugins jQuery nenhuns, isto ficava morto em silêncio.
Trocado por new bootstrap.Modal(...).show(), a API JS nativa do
BS5. grep confirma zero outras chamadas .modal()/.collapse()/etc.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
93 lines
5.0 KiB
PHP
93 lines
5.0 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="#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="preconnect" href="https://fonts.googleapis.com" crossorigin>
|
||
<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 -->
|
||
<link rel="preload" as="image" fetchpriority="high" href="<?= htmlspecialchars(base_url(($gym_meta['hero_image'] ?? '') !== '' ? $gym_meta['hero_image'] : 'site/assets/img/home.jpg')) ?>">
|
||
<?php endif; ?>
|
||
|
||
<!-- Fonts -->
|
||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700,900&display=swap" rel="stylesheet">
|
||
|
||
<!-- Vendor: Bootstrap 4.3.1 -->
|
||
<?= link_tag('assets/vendor/bootstrap5/css/bootstrap.min.css') ?>
|
||
|
||
<!-- Vendor: Font Awesome 5 -->
|
||
<?= link_tag('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') ?>
|
||
</head>
|
||
<body>
|
||
<a href="#conteudo" class="skip-link">Saltar para o conteúdo</a>
|