Skip to content

Commit bc754a0

Browse files
committed
feat: centralizza i contenuti della home page in un file di configurazione
1 parent ebee2e7 commit bc754a0

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

src/components/HomePage.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Initiative } from '../types/initiative';
33
import InitiativeCard from './InitiativeCard';
44
import SearchAndFilters from './SearchAndFilters';
55
import Pagination from './Pagination';
6+
import { homeContent } from '../config/content';
67

78
const ITEMS_PER_PAGE = 12;
89

@@ -70,10 +71,10 @@ export default function HomePage({ initiatives: allInitiatives, baseUrl = '/', h
7071
{/* Title */}
7172
<div className="text-center">
7273
<h1 className="text-3xl font-bold text-gray-900 sm:text-4xl">
73-
Referendum e Iniziative Popolari
74+
{homeContent.title}
7475
</h1>
7576
<p className="mt-2 text-lg text-gray-600">
76-
Scopri e partecipa alle iniziative democratiche in corso
77+
{homeContent.subtitle}
7778
</p>
7879
</div>
7980
</div>

src/config/content.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Configurazione centralizzata per i contenuti della home page
2+
export const homeContent = {
3+
title: 'Referendum e Iniziative Popolari',
4+
subtitle: 'Scopri e partecipa alle iniziative democratiche',
5+
};

src/layouts/Layout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
import '../styles/global.css';
3+
import { homeContent } from '../config/content';
34
45
export interface Props {
56
title: string;
@@ -10,7 +11,7 @@ export interface Props {
1011
1112
const {
1213
title,
13-
description = "Scopri e partecipa alle iniziative democratiche in corso",
14+
description = homeContent.subtitle,
1415
ogImage = "og-default.png",
1516
ogType = "website"
1617
} = Astro.props;

src/pages/index.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ import HomePage from '../components/HomePage';
44
import HamburgerMenuNative from '../components/HamburgerMenuNative.astro';
55
import Footer from '../components/Footer.astro';
66
import { fetchInitiatives } from '../lib/initiatives';
7+
import { homeContent } from '../config/content';
78
89
// Carica i dati delle iniziative
910
const initiatives = await fetchInitiatives();
1011
---
1112

12-
<Layout title="Referendum e Iniziative Popolari">
13+
<Layout title={homeContent.title}>
1314
<div class="min-h-screen bg-gray-50">
1415
<!-- Header con menu hamburger -->
1516
<header class="bg-white shadow-sm border-b border-gray-200">
@@ -22,10 +23,10 @@ const initiatives = await fetchInitiatives();
2223
<!-- Title -->
2324
<div class="text-center">
2425
<h1 class="text-3xl font-bold text-gray-900 sm:text-4xl">
25-
Referendum e Iniziative Popolari
26+
{homeContent.title}
2627
</h1>
2728
<p class="mt-2 text-lg text-gray-600">
28-
Scopri e partecipa alle iniziative democratiche in corso
29+
{homeContent.subtitle}
2930
</p>
3031
</div>
3132
</div>

0 commit comments

Comments
 (0)