Migrate CMS from Sanity to self-hosted Directus, add Impressum + Datenschutz
- Replace src/lib/sanity.ts with src/lib/directus.ts (REST API client) - Update all 9 pages to use Directus field names and imageUrl() - Add Impressum (§5 TMG) and Datenschutz (DSGVO) pages - Update .env.example for Directus URL + token Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
---
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import { getAllProjects } from "../../lib/sanity";
|
||||
import { getAllProjects, imageUrl } from "../../lib/directus";
|
||||
|
||||
const projects = await getAllProjects();
|
||||
|
||||
const statusLabel: Record<string, string> = {
|
||||
planned: "Geplant",
|
||||
active: "Laufend",
|
||||
running: "Laufend",
|
||||
done: "Abgeschlossen",
|
||||
};
|
||||
const statusColor: Record<string, string> = {
|
||||
planned: "var(--color-rb-blue)",
|
||||
active: "var(--color-rb-green)",
|
||||
running: "var(--color-rb-green)",
|
||||
done: "var(--color-text-muted)",
|
||||
};
|
||||
---
|
||||
@@ -41,10 +41,10 @@ const statusColor: Record<string, string> = {
|
||||
<section class="section pt-0">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{projects.map((p: any) => (
|
||||
<a href={`/projekte/${p.slug.current}`} class="card group">
|
||||
{p.image?.asset?.url ? (
|
||||
<a href={`/projekte/${p.slug}`} class="card group">
|
||||
{p.image ? (
|
||||
<div class="aspect-video rounded-xl overflow-hidden mb-4 bg-[var(--color-surface-alt)]">
|
||||
<img src={`${p.image.asset.url}?w=600&auto=format`} alt={p.title} class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" />
|
||||
<img src={imageUrl(p.image, 600)} alt={p.title} class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300" />
|
||||
</div>
|
||||
) : (
|
||||
<div class="aspect-video rounded-xl mb-4 bg-[var(--color-surface-alt)] flex items-center justify-center text-4xl">🎭</div>
|
||||
@@ -58,8 +58,8 @@ const statusColor: Record<string, string> = {
|
||||
</div>
|
||||
<h3 class="font-bold text-lg mb-2 group-hover:text-[var(--color-primary)] transition-colors">{p.title}</h3>
|
||||
<p class="text-sm text-[var(--color-text-muted)] line-clamp-3">{p.summary}</p>
|
||||
{p.targetGroup && (
|
||||
<p class="text-xs text-[var(--color-text-muted)] mt-3">👥 {p.targetGroup}</p>
|
||||
{p.target_group && (
|
||||
<p class="text-xs text-[var(--color-text-muted)] mt-3">👥 {p.target_group}</p>
|
||||
)}
|
||||
</a>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user