fix: sitemap senza admin, categorie sidebar reali, 404 blog, og:image e README
- IMP-1: sitemap filter esclude /admin - IMP-2: [slug].astro programmi usa CATEGORIES da blog-const con link /blog?categoria= - MIN-1: blog/[slug].astro ritorna 404 vera invece di redirect - MIN-3: public/img/og.jpg + meta og:image in Base.astro - README: porta 3000→4321, Astro 5→7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,11 +4,11 @@ Sito vetrina per InsanityLab con blog integrato e form di contatti.
|
|||||||
|
|
||||||
## Descrizione
|
## Descrizione
|
||||||
|
|
||||||
Il progetto realizza un sito web per InsanityLab, combinando una vetrina aziendale con un sistema di blog gestito tramite SQLite e un form di contatti funzionante. L'architettura è costruita su **Astro 5** con adapter **Node.js** per deployment su server, garantendo performance ottimali e SEO-friendly pages.
|
Il progetto realizza un sito web per InsanityLab, combinando una vetrina aziendale con un sistema di blog gestito tramite SQLite e un form di contatti funzionante. L'architettura è costruita su **Astro 7** con adapter **Node.js** per deployment su server, garantendo performance ottimali e SEO-friendly pages.
|
||||||
|
|
||||||
## Stack Tecnologico
|
## Stack Tecnologico
|
||||||
|
|
||||||
- **Framework**: Astro 5
|
- **Framework**: Astro 7
|
||||||
- **Runtime**: Node.js (adapter standalone)
|
- **Runtime**: Node.js (adapter standalone)
|
||||||
- **Database**: SQLite (better-sqlite3)
|
- **Database**: SQLite (better-sqlite3)
|
||||||
- **Autenticazione**: bcryptjs
|
- **Autenticazione**: bcryptjs
|
||||||
@@ -44,7 +44,7 @@ Modifica `.env` con le credenziali SMTP, percorsi database e upload directory se
|
|||||||
|
|
||||||
| Comando | Descrizione |
|
| Comando | Descrizione |
|
||||||
|---------|-------------|
|
|---------|-------------|
|
||||||
| `npm run dev` | Avvia il server di sviluppo (localhost:3000) |
|
| `npm run dev` | Avvia il server di sviluppo (localhost:4321) |
|
||||||
| `npm run build` | Compila il progetto per production |
|
| `npm run build` | Compila il progetto per production |
|
||||||
| `npm run preview` | Visualizza l'anteprima della build (locale) |
|
| `npm run preview` | Visualizza l'anteprima della build (locale) |
|
||||||
| `npm run start` | Avvia il server production (richiede `npm run build` preliminare) |
|
| `npm run start` | Avvia il server production (richiede `npm run build` preliminare) |
|
||||||
|
|||||||
+1
-1
@@ -6,5 +6,5 @@ export default defineConfig({
|
|||||||
site: 'https://insanitylab.tielogic.xyz',
|
site: 'https://insanitylab.tielogic.xyz',
|
||||||
output: 'server',
|
output: 'server',
|
||||||
adapter: node({ mode: 'standalone' }),
|
adapter: node({ mode: 'standalone' }),
|
||||||
integrations: [sitemap()],
|
integrations: [sitemap({ filter: (page) => !page.includes('/admin') })],
|
||||||
});
|
});
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
@@ -22,6 +22,7 @@ const { title, description = 'InsanityLab — Performance. Balance. Longevity. A
|
|||||||
<meta property="og:title" content={`${title} — InsanityLab`} />
|
<meta property="og:title" content={`${title} — InsanityLab`} />
|
||||||
<meta property="og:description" content={description} />
|
<meta property="og:description" content={description} />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:image" content={new URL('/img/og.jpg', Astro.site)} />
|
||||||
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
||||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { getPublishedBySlug } from '../../lib/posts';
|
|||||||
export const prerender = false;
|
export const prerender = false;
|
||||||
|
|
||||||
const post = getPublishedBySlug(getDb(), Astro.params.slug!);
|
const post = getPublishedBySlug(getDb(), Astro.params.slug!);
|
||||||
if (!post) return Astro.redirect('/404');
|
if (!post) return new Response(null, { status: 404 });
|
||||||
const fmt = new Intl.DateTimeFormat('it-IT', { dateStyle: 'long' });
|
const fmt = new Intl.DateTimeFormat('it-IT', { dateStyle: 'long' });
|
||||||
---
|
---
|
||||||
<Base title={post.title} description={post.excerpt}>
|
<Base title={post.title} description={post.excerpt}>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import Base from '../../layouts/Base.astro';
|
|||||||
import PageHero from '../../components/PageHero.astro';
|
import PageHero from '../../components/PageHero.astro';
|
||||||
import { programs } from '../../data/programs';
|
import { programs } from '../../data/programs';
|
||||||
import { performanceClassPricing } from '../../data/pricing';
|
import { performanceClassPricing } from '../../data/pricing';
|
||||||
|
import { CATEGORIES } from '../../lib/blog-const';
|
||||||
export const prerender = true;
|
export const prerender = true;
|
||||||
|
|
||||||
export function getStaticPaths() {
|
export function getStaticPaths() {
|
||||||
@@ -10,7 +11,6 @@ export function getStaticPaths() {
|
|||||||
}
|
}
|
||||||
const { program } = Astro.props;
|
const { program } = Astro.props;
|
||||||
const others = programs.filter((p) => p.slug !== program.slug);
|
const others = programs.filter((p) => p.slug !== program.slug);
|
||||||
const blogCategories = ['Fitness', 'Salute', 'Stile di vita', 'Nutrizione'];
|
|
||||||
---
|
---
|
||||||
<Base title={program.title} description={program.excerpt}>
|
<Base title={program.title} description={program.excerpt}>
|
||||||
<PageHero title={program.title.toUpperCase()} />
|
<PageHero title={program.title.toUpperCase()} />
|
||||||
@@ -34,7 +34,7 @@ const blogCategories = ['Fitness', 'Salute', 'Stile di vita', 'Nutrizione'];
|
|||||||
</div>
|
</div>
|
||||||
<aside class="prog__side">
|
<aside class="prog__side">
|
||||||
<h3>Categorie</h3>
|
<h3>Categorie</h3>
|
||||||
{blogCategories.map((c) => <p><a href="/blog">{c}</a></p>)}
|
{CATEGORIES.map((c) => <p><a href={`/blog?categoria=${encodeURIComponent(c)}`}>{c}</a></p>)}
|
||||||
<h3>Altri programmi</h3>
|
<h3>Altri programmi</h3>
|
||||||
{others.map((o) => <p><a href={`/programs/${o.slug}`}>{o.title}</a></p>)}
|
{others.map((o) => <p><a href={`/programs/${o.slug}`}>{o.title}</a></p>)}
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
Reference in New Issue
Block a user