Update site content and structure, including localization adjustments for addresses, removal of unused files, and enhancements to the layout and styling for better user experience.
This commit is contained in:
@@ -41,7 +41,7 @@ const pageStructuredData = {
|
||||
},
|
||||
"serviceArea": {
|
||||
"@type": "Country",
|
||||
"name": "Italy"
|
||||
"name": "Netherlands"
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -1,28 +1,70 @@
|
||||
---
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
import Header from '../../components/Header.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
import { getBlogPostBySlug, getBlogPosts } from '../../utils/directus';
|
||||
import { useTranslations } from '../../utils/i18n';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
// Get all blog posts to create redirects
|
||||
const { getBlogPosts } = await import('../../utils/directus');
|
||||
const posts = await getBlogPosts();
|
||||
|
||||
return posts
|
||||
.filter((post) => typeof post.slug === 'string' && post.slug.trim() !== '')
|
||||
.map((post) => ({
|
||||
params: { slug: post.slug },
|
||||
props: { slug: post.slug },
|
||||
props: { post },
|
||||
}));
|
||||
}
|
||||
|
||||
const { slug } = Astro.props;
|
||||
const { post } = Astro.props;
|
||||
const t = await useTranslations('en');
|
||||
---
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Redirecting...</title>
|
||||
<meta http-equiv="refresh" content="0;url=/en/blog/{slug}">
|
||||
<link rel="canonical" href="/en/blog/{slug}">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="/en/blog/{slug}">blog post</a>...</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<BaseLayout title={`${post.title} | ${t('blog.title')}`} description={post.content.replace(/<[^>]+>/g, '').substring(0, 160)}>
|
||||
<Header />
|
||||
|
||||
<main class="flex-1">
|
||||
<!-- Hero Section -->
|
||||
<section class="bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800 py-20">
|
||||
<div class="container-custom">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<nav class="mb-6">
|
||||
<a href="/en/blog" class="text-primary hover:underline flex items-center">
|
||||
← {t('blog.backToBlog')}
|
||||
</a>
|
||||
</nav>
|
||||
<header class="text-center">
|
||||
<h1 class="text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6">
|
||||
{post.title}
|
||||
</h1>
|
||||
<p class="text-xl text-gray-600 dark:text-gray-300">
|
||||
{new Date(post.date_created).toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'long',
|
||||
day: 'numeric'
|
||||
})}
|
||||
</p>
|
||||
</header>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Article Content -->
|
||||
<section class="py-16">
|
||||
<div class="container-custom">
|
||||
<article class="max-w-4xl mx-auto">
|
||||
<div class="prose prose-lg dark:prose-invert max-w-none prose-headings:text-gray-900 dark:prose-headings:text-white prose-p:text-gray-700 dark:prose-p:text-gray-300 prose-a:text-primary prose-a:no-underline hover:prose-a:underline prose-strong:text-gray-900 dark:prose-strong:text-white prose-code:text-primary prose-code:bg-gray-100 dark:prose-code:bg-gray-800 prose-code:px-1 prose-code:py-0.5 prose-code:rounded" set:html={post.content}></div>
|
||||
|
||||
<!-- Back to Blog Button -->
|
||||
<div class="mt-12 pt-8 border-t border-border text-center">
|
||||
<a href="/en/blog" class="btn btn-primary">
|
||||
← {t('blog.backToBlog')}
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</BaseLayout>
|
@@ -1,15 +1,97 @@
|
||||
---
|
||||
// Static redirect to English blog
|
||||
import BaseLayout from '../../layouts/BaseLayout.astro';
|
||||
import Header from '../../components/Header.astro';
|
||||
import Footer from '../../components/Footer.astro';
|
||||
import { getBlogPosts } from '../../utils/directus';
|
||||
import { useTranslations } from '../../utils/i18n';
|
||||
|
||||
const t = await useTranslations('en');
|
||||
|
||||
let posts = [];
|
||||
let error = null;
|
||||
|
||||
function stripHtml(html) {
|
||||
return html.replace(/<[^>]+>/g, '');
|
||||
}
|
||||
|
||||
try {
|
||||
posts = await getBlogPosts();
|
||||
} catch (e) {
|
||||
console.error('Error in blog page:', e);
|
||||
error = e.message;
|
||||
}
|
||||
---
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Redirecting...</title>
|
||||
<meta http-equiv="refresh" content="0;url=/en/blog">
|
||||
<link rel="canonical" href="/en/blog">
|
||||
</head>
|
||||
<body>
|
||||
<p>Redirecting to <a href="/en/blog">blog</a>...</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<BaseLayout title={t('blog.title')} description={t('blog.description')}>
|
||||
<Header />
|
||||
|
||||
<main class="flex-1">
|
||||
<!-- Hero Section -->
|
||||
<section class="bg-gradient-to-br from-blue-50 to-indigo-100 dark:from-gray-900 dark:to-gray-800 py-20">
|
||||
<div class="container-custom">
|
||||
<div class="text-center max-w-3xl mx-auto">
|
||||
<h1 class="text-4xl md:text-5xl font-bold text-gray-900 dark:text-white mb-6">
|
||||
{t('blog.title')}
|
||||
</h1>
|
||||
<p class="text-xl text-gray-600 dark:text-gray-300">
|
||||
{t('blog.description')}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Blog Posts Section -->
|
||||
<section class="py-16">
|
||||
<div class="container-custom">
|
||||
{error ? (
|
||||
<div class="bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-6 mb-8">
|
||||
<p class="text-red-800 dark:text-red-200">
|
||||
{t('blog.error')}
|
||||
</p>
|
||||
{import.meta.env.DEV && (
|
||||
<pre class="mt-2 text-sm text-red-600 dark:text-red-400">{error}</pre>
|
||||
)}
|
||||
</div>
|
||||
) : posts.length === 0 ? (
|
||||
<div class="text-center py-12">
|
||||
<p class="text-gray-600 dark:text-gray-400 text-lg">
|
||||
{t('blog.noPosts')}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
|
||||
{posts.map((post) => (
|
||||
<article class="card hover:shadow-lg transition-shadow duration-300 group">
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="flex-1">
|
||||
<h2 class="text-xl font-bold mb-3 group-hover:text-primary transition-colors">
|
||||
<a href={`/en/blog/${post.slug}`} class="hover:underline">
|
||||
{post.title}
|
||||
</a>
|
||||
</h2>
|
||||
<p class="text-muted-foreground text-sm mb-4">
|
||||
{new Date(post.date_created).toLocaleDateString('en-US')}
|
||||
</p>
|
||||
<div class="text-foreground text-sm mb-6 line-clamp-4">
|
||||
{stripHtml(post.content).substring(0, 200)}{stripHtml(post.content).length > 200 ? '...' : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pt-4 border-t border-border">
|
||||
<a
|
||||
href={`/en/blog/${post.slug}`}
|
||||
class="inline-flex items-center text-primary font-medium hover:underline transition-colors"
|
||||
>
|
||||
{t('blog.readMore')} →
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</BaseLayout>
|
@@ -1,4 +1,25 @@
|
||||
---
|
||||
// Redirect to English version
|
||||
return Astro.redirect('/en/');
|
||||
---
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
import Header from '../components/Header.astro';
|
||||
import Footer from '../components/Footer.astro';
|
||||
import Hero from '../components/Hero.astro';
|
||||
import Services from '../components/Services.astro';
|
||||
import Testimonials from '../components/Testimonials.astro';
|
||||
import CTA from '../components/CTA.astro';
|
||||
import { useTranslations } from '../utils/i18n';
|
||||
|
||||
const t = await useTranslations('en');
|
||||
---
|
||||
|
||||
<BaseLayout title={t('home.title')} description={t('home.description')}>
|
||||
<Header />
|
||||
|
||||
<main class="flex-1">
|
||||
<Hero />
|
||||
<Services />
|
||||
<Testimonials />
|
||||
<CTA />
|
||||
</main>
|
||||
|
||||
<Footer />
|
||||
</BaseLayout>
|
Reference in New Issue
Block a user