feat: conformità legale, pagine legali, .htaccess e robots.txt
- privacy policy, cookie policy, note legali e accessibilità in Markdown, scritte ex novo sull'uso effettivo del sito, con dati da studio.ts (segnaposto e blocchi condizionali risolti a build time) - dati societari ex art. 2250 c.c., fornitori e polizza RC previsti in studio.ts: compaiono appena valorizzati - .htaccess: HTTPS, redirect del vecchio sito, CSP e header di sicurezza, 404, blocco file nascosti e .map, compressione e cache - robots.txt generato dal valore di SITE_URL; sitemap senza pagina di conferma - docs/CONFORMITA.md, TODO-STUDIO.md completo, public/images/README.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zJ9ZWGKvoKoxYwbmnRKdJ
This commit is contained in:
18 files changed
+930
-4
No files matched your search
@@ -0,0 +1,185 @@
|
||||
---
|
||||
/**
|
||||
* Pagina «documento» (privacy, cookie, note legali, accessibilità): colonna singola leggibile
|
||||
* (max 68 caratteri), indice interno e data dell'ultimo aggiornamento (dal frontmatter).
|
||||
*/
|
||||
import type { MarkdownHeading } from 'astro';
|
||||
import { getEntry } from 'astro:content';
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
import { formatDateIt } from '../lib/format';
|
||||
import { renderLegal } from '../lib/legal';
|
||||
import PageHead from './PageHead.astro';
|
||||
|
||||
interface Props {
|
||||
/** Nome del file in src/content/legali, senza estensione. */
|
||||
id: 'privacy-policy' | 'cookie-policy' | 'note-legali' | 'accessibilita';
|
||||
/** Etichetta della data in testa al documento. */
|
||||
dataLabel?: string;
|
||||
}
|
||||
|
||||
const { id, dataLabel = 'Ultimo aggiornamento' } = Astro.props;
|
||||
const entry = await getEntry('legali', id);
|
||||
if (!entry) throw new Error(`Testo legale mancante: src/content/legali/${id}.md`);
|
||||
const html = renderLegal(entry.rendered?.html ?? '', `src/content/legali/${id}.md`);
|
||||
const allHeadings = (entry.rendered?.metadata?.headings ?? []) as MarkdownHeading[];
|
||||
const headings = allHeadings.filter((h) => h.depth === 2);
|
||||
const path = `/${id}/`;
|
||||
const breadcrumbs = [{ name: entry.data.titolo, href: path }];
|
||||
const updated = entry.data.aggiornato;
|
||||
---
|
||||
|
||||
<BaseLayout
|
||||
title={entry.data.titolo}
|
||||
description={entry.data.descrizioneSeo}
|
||||
breadcrumbs={breadcrumbs}
|
||||
>
|
||||
<PageHead title={entry.data.titolo} subtitle={entry.data.sottotitolo} breadcrumbs={breadcrumbs}>
|
||||
<p class="doc-updated">
|
||||
{dataLabel}:{' '}
|
||||
<time datetime={updated.toISOString().slice(0, 10)}>{formatDateIt(updated)}</time>
|
||||
</p>
|
||||
</PageHead>
|
||||
|
||||
<section class="section">
|
||||
<div class="container doc-layout">
|
||||
{headings.length > 1 && (
|
||||
<nav class="doc-toc" aria-labelledby="indice-titolo">
|
||||
<p class="doc-toc__title" id="indice-titolo">
|
||||
Indice
|
||||
</p>
|
||||
<ol role="list">
|
||||
{headings.map((h) => (
|
||||
<li>
|
||||
<a href={`#${h.slug}`}>{h.text}</a>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</nav>
|
||||
)}
|
||||
<article class="doc" set:html={html} />
|
||||
</div>
|
||||
</section>
|
||||
</BaseLayout>
|
||||
|
||||
<style>
|
||||
.doc-updated {
|
||||
margin: var(--space-4) 0 0;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.doc-layout {
|
||||
display: grid;
|
||||
grid-template-columns: 260px minmax(0, 1fr);
|
||||
gap: var(--space-8);
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.doc-toc {
|
||||
position: sticky;
|
||||
top: calc(var(--header-h) + 1.5rem);
|
||||
padding: var(--space-4);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--white);
|
||||
}
|
||||
|
||||
.doc-toc__title {
|
||||
margin: 0 0 var(--space-2);
|
||||
font-size: var(--fs-xs);
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
.doc-toc ol {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.doc-toc a {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: var(--tap);
|
||||
padding: 0.35rem 0.5rem;
|
||||
border-radius: var(--radius-sm);
|
||||
color: var(--ink-700);
|
||||
font-size: var(--fs-sm);
|
||||
line-height: 1.35;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.doc-toc a:hover {
|
||||
background: var(--navy-050);
|
||||
color: var(--navy-900);
|
||||
}
|
||||
|
||||
.doc :global(.doc-card) {
|
||||
margin: var(--space-4) 0 var(--space-5);
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--navy-050);
|
||||
}
|
||||
|
||||
.doc :global(dl.doc-card) {
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr);
|
||||
gap: 0.4rem var(--space-4);
|
||||
font-size: var(--fs-sm);
|
||||
}
|
||||
|
||||
.doc :global(dl.doc-card dt) {
|
||||
color: var(--ink-600);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.doc :global(dl.doc-card dd) {
|
||||
margin: 0;
|
||||
color: var(--ink-900);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.doc :global(section.doc-card h3) {
|
||||
margin: 0 0 var(--space-2);
|
||||
}
|
||||
|
||||
.doc :global(section.doc-card ul) {
|
||||
margin-bottom: var(--space-2);
|
||||
}
|
||||
|
||||
.doc :global(.doc-card__law) {
|
||||
font-weight: 600;
|
||||
color: var(--ink-900);
|
||||
}
|
||||
|
||||
.doc :global(.doc-card__meta) {
|
||||
margin: 0;
|
||||
font-size: var(--fs-sm);
|
||||
color: var(--ink-600);
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.doc-layout {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: var(--space-6);
|
||||
}
|
||||
|
||||
.doc-toc {
|
||||
position: static;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.doc :global(dl.doc-card) {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
gap: 0.1rem;
|
||||
}
|
||||
|
||||
.doc :global(dl.doc-card dd + dt) {
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user