feat: design system, layout e componenti di base
- token, font self-hosted (Fraunces e Inter, sottoinsieme latin) con preload - BaseLayout con head completo (SEO, Open Graph, favicon) e JSON-LD dello studio - intestazione con barra superiore, navigazione e sottomenu servizi accessibili - menu mobile con dialog modale e alternativa senza JavaScript - footer con P.IVA, recapiti, servizi, orari e link legali - componenti: Logo, Icon (Lucide inline), Hero, card servizio, scheda professionista, badge abilitazione, card sede, mappa click-to-load, modulo di contatto, banda CTA, breadcrumb, intestazioni di sezione - generate-icons.mjs: marchio, favicon, apple-touch-icon e immagine OG - collection dei servizi e dei link utili con schemi Zod Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
This commit is contained in:
58 files changed
+5077
-16
No files matched your search
@@ -0,0 +1,142 @@
|
||||
---
|
||||
/**
|
||||
* Layout di base di tutte le pagine: <head> completo (SEO, Open Graph, favicon, preload dei
|
||||
* font, JSON-LD), link «salta al contenuto», intestazione e footer.
|
||||
*/
|
||||
import frauncesUrl from '@fontsource-variable/fraunces/files/fraunces-latin-wght-normal.woff2?url';
|
||||
import interUrl from '@fontsource-variable/inter/files/inter-latin-wght-normal.woff2?url';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import { studio } from '../data/studio';
|
||||
import { breadcrumbLd, jsonLdScript, organizationLd, pageTitle, type Crumb } from '../lib/seo';
|
||||
import { getServizi } from '../lib/servizi';
|
||||
import '../styles/tokens.css';
|
||||
import '../styles/fonts.css';
|
||||
import '../styles/global.css';
|
||||
import '../styles/print.css';
|
||||
|
||||
interface Props {
|
||||
/** Titolo breve della pagina (senza suffisso). */
|
||||
title: string;
|
||||
/** Titolo completo già formattato (solo home). */
|
||||
fullTitle?: string;
|
||||
description: string;
|
||||
/** Percorso di navigazione, esclusa la home (aggiunta automaticamente). */
|
||||
breadcrumbs?: Crumb[];
|
||||
noindex?: boolean;
|
||||
/** Dati strutturati aggiuntivi (es. Service). */
|
||||
jsonLd?: Record<string, unknown>[];
|
||||
ogType?: 'website' | 'article';
|
||||
}
|
||||
|
||||
const {
|
||||
title,
|
||||
fullTitle,
|
||||
description,
|
||||
breadcrumbs,
|
||||
noindex = false,
|
||||
jsonLd = [],
|
||||
ogType = 'website',
|
||||
} = Astro.props;
|
||||
|
||||
if (!Astro.site) throw new Error('Configurare `site` in astro.config.mjs (variabile SITE_URL).');
|
||||
const site = Astro.site;
|
||||
const documentTitle = fullTitle ?? pageTitle(title);
|
||||
const canonical = new URL(Astro.url.pathname, site).href;
|
||||
const ogImage = new URL('/og-default.png', site).href;
|
||||
const crumbs: Crumb[] | undefined = breadcrumbs?.length
|
||||
? [{ name: 'Home', href: '/' }, ...breadcrumbs]
|
||||
: undefined;
|
||||
|
||||
const graph: unknown[] = [organizationLd(site)];
|
||||
if (crumbs) graph.push(breadcrumbLd(site, crumbs));
|
||||
graph.push(...jsonLd);
|
||||
|
||||
const servizi = await getServizi();
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>{documentTitle}</title>
|
||||
<meta name="description" content={description} />
|
||||
<link rel="canonical" href={canonical} />
|
||||
{noindex && <meta name="robots" content="noindex, follow" />}
|
||||
<meta name="theme-color" content="#0f2a44" />
|
||||
<meta name="color-scheme" content="light" />
|
||||
|
||||
<link rel="icon" href="/favicon.ico" sizes="32x32" />
|
||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="sitemap" type="application/xml" href="/sitemap-index.xml" />
|
||||
|
||||
<link rel="preload" href={frauncesUrl} as="font" type="font/woff2" crossorigin />
|
||||
<link rel="preload" href={interUrl} as="font" type="font/woff2" crossorigin />
|
||||
|
||||
<meta property="og:type" content={ogType} />
|
||||
<meta property="og:locale" content="it_IT" />
|
||||
<meta property="og:site_name" content={`${studio.nome} — ${studio.sottotitolo}`} />
|
||||
<meta property="og:title" content={documentTitle} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:url" content={canonical} />
|
||||
<meta property="og:image" content={ogImage} />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:image:alt" content={`${studio.nome} — ${studio.payoff}`} />
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content={documentTitle} />
|
||||
<meta name="twitter:description" content={description} />
|
||||
<meta name="twitter:image" content={ogImage} />
|
||||
|
||||
<script type="application/ld+json" set:html={jsonLdScript(graph)} />
|
||||
<noscript>
|
||||
<style>
|
||||
.js-only {
|
||||
display: none !important;
|
||||
}
|
||||
.nav__item--has-sub:focus-within .nav__sub {
|
||||
display: block;
|
||||
}
|
||||
.submenu-list {
|
||||
display: block !important;
|
||||
}
|
||||
@media (max-width: 960px) {
|
||||
.site-header {
|
||||
position: static !important;
|
||||
}
|
||||
.site-header__inner {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.menu-toggle,
|
||||
.mobile-menu__head {
|
||||
display: none !important;
|
||||
}
|
||||
.mobile-menu {
|
||||
display: block !important;
|
||||
position: static !important;
|
||||
width: 100% !important;
|
||||
max-width: none !important;
|
||||
height: auto !important;
|
||||
max-height: none !important;
|
||||
margin: 0 0 var(--space-4) !important;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#contenuto">
|
||||
Vai al contenuto principale
|
||||
</a>
|
||||
<Header servizi={servizi} />
|
||||
<main id="contenuto" tabindex="-1">
|
||||
<slot />
|
||||
</main>
|
||||
<Footer servizi={servizi} />
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user