From 275e479aba9ed056fcf122feb81bfd175725e6bd Mon Sep 17 00:00:00 2001 From: Lara Date: Wed, 21 Oct 2026 11:13:06 +0200 Subject: [PATCH] SEO groundwork; hide the empty 'Wie wir arbeiten' block MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - robots.txt and sitemap.xml (both answered with the homepage before) - real 404 page; nginx returns 404 instead of the homepage for unknown paths - gzip and caching for fonts, images, videos - JSON-LD as one graph: ProfessionalService (+founders, offer), WebSite, FAQPage built from the FAQ answers - sharper title and a meta description under 160 characters, real descriptions for imprint and privacy pages - imprint cites § 5 DDG (TMG was replaced in May 2024) - empty kontakt.howWeWork hides the block instead of a red placeholder Co-Authored-By: Claude Opus 5.5 --- admin/lib/schema.js | 4 ++-- content/site.json | 2 +- nginx.conf | 21 +++++++++++++++++++-- public/robots.txt | 4 ++++ src/layouts/Layout.astro | 34 +++++++++++++++++++++++++++++++--- src/pages/404.astro | 14 ++++++++++++++ src/pages/datenschutz.astro | 2 +- src/pages/impressum.astro | 4 ++-- src/pages/index.astro | 27 ++++++++++++++++++++------- src/pages/sitemap.xml.ts | 15 +++++++++++++++ 10 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 public/robots.txt create mode 100644 src/pages/404.astro create mode 100644 src/pages/sitemap.xml.ts diff --git a/admin/lib/schema.js b/admin/lib/schema.js index c839e0d..645f406 100644 --- a/admin/lib/schema.js +++ b/admin/lib/schema.js @@ -240,10 +240,10 @@ module.exports = [ { key: 'eyebrow', label: 'Kicker-Zeile', type: 'text' }, { key: 'title', label: 'Überschrift', type: 'text' }, { key: 'lead', label: 'Einleitungstext', type: 'richtext' }, - { key: 'phone', label: 'Telefonnummer (leer = Platzhalter)', type: 'text' }, + { key: 'phone', label: 'Telefonnummer (leer = ausgeblendet, auch im Impressum)', type: 'text' }, { key: 'hours', label: 'Telefonische Erreichbarkeit unter der Nummer (leer = ausgeblendet)', type: 'text' }, { key: 'email', label: 'E-Mail-Adresse', type: 'email' }, - { key: 'howWeWork', label: '"Wie wir arbeiten" (leer = Platzhalter)', type: 'textarea' }, + { key: 'howWeWork', label: '"Wie wir arbeiten" (leer = ausgeblendet)', type: 'textarea' }, ], }, { diff --git a/content/site.json b/content/site.json index a72825c..c07ea7d 100644 --- a/content/site.json +++ b/content/site.json @@ -1,6 +1,6 @@ { "meta": { - "description": "Larpaso aus Hannover baut Websites für Inhaberbetriebe, Praxen und Handwerk: Angebot, Preise, Zeiten und Anfahrt auf einen Blick, gut bedienbar auf dem Handy, zum Festpreis." + "description": "Webdesign aus Hannover: Larpaso baut Websites für Inhaberbetriebe, Praxen und Handwerk in ganz Deutschland. Individuell, handyfreundlich, zum Festpreis." }, "nav": { "logo": "/logo.svg", diff --git a/nginx.conf b/nginx.conf index ba951cd..5f794f0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -8,14 +8,31 @@ server { # (so steht es auch in der Datenschutzerklaerung). Fehler weiter melden. access_log off; - # Saubere URLs + Fallback + # Komprimieren: HTML/CSS/JS/SVG kommen deutlich kleiner beim Besucher an + gzip on; + gzip_comp_level 6; + gzip_min_length 512; + gzip_vary on; + gzip_proxied any; + gzip_types text/plain text/css text/xml application/xml application/javascript + application/json application/ld+json image/svg+xml; + + # Saubere URLs. Unbekannte Adressen bekommen eine echte 404 statt der + # Startseite (sonst wertet Google sie als "Soft 404" / doppelte Inhalte). location / { - try_files $uri $uri/ $uri.html /index.html; + try_files $uri $uri/ $uri.html =404; } + error_page 404 /404.html; # Astro legt gehashte Assets unter /_astro ab -> lange cachen location /_astro/ { expires 1y; add_header Cache-Control "public, immutable"; } + + # Schriften, Bilder, Videos: aendern sich selten + location ~* \.(woff2|webp|jpg|jpeg|png|svg|ico|mp4)$ { + expires 7d; + add_header Cache-Control "public"; + } } diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..be30b2b --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://larpaso.de/sitemap.xml diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index a1549d7..23020ab 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -7,15 +7,21 @@ import { site, theme, themeCss, fontFacesCss } from '../lib/content'; interface Props { title: string; description?: string; + /** Zusätzliche schema.org-Objekte nur für diese Seite (z. B. FAQPage). */ + schema?: Record[]; + /** Seite nicht in Suchmaschinen aufnehmen (404). */ + noindex?: boolean; } -const { title, description = site.meta.description } = Astro.props; +const { title, description = site.meta.description, schema = [], noindex = false } = Astro.props; const canonical = new URL(Astro.url.pathname, Astro.site).href; const ogImage = new URL('/og-larpaso.jpg', Astro.site).href; +const orgId = new URL('/#larpaso', Astro.site).href; const orgData = { - '@context': 'https://schema.org', '@type': 'ProfessionalService', + '@id': orgId, name: 'Larpaso', + alternateName: 'larpaso Webdesign', description: site.meta.description, url: Astro.site?.href, logo: new URL('/icon-512.png', Astro.site).href, @@ -25,7 +31,28 @@ const orgData = { address: { '@type': 'PostalAddress', addressLocality: 'Hannover', addressRegion: 'Niedersachsen', addressCountry: 'DE' }, areaServed: { '@type': 'Country', name: 'Deutschland' }, priceRange: 'ab 500 €', + founder: [ + { '@type': 'Person', name: `Lara ${site.footer.laraNachname}` }, + { '@type': 'Person', name: `Pascal ${site.footer.pascalNachname}` }, + ], + knowsAbout: ['Webdesign', 'Websites für kleine Betriebe', 'Responsive Webdesign', 'Suchmaschinenoptimierung', 'Barrierefreiheit'], + makesOffer: { + '@type': 'Offer', + name: 'Website zum Festpreis', + price: '500', + priceCurrency: 'EUR', + description: 'Individuelle Website mit Texten, Gestaltung und Veröffentlichung, einmaliger Festpreis.', + }, }; +const siteData = { + '@type': 'WebSite', + '@id': new URL('/#website', Astro.site).href, + name: 'Larpaso', + url: Astro.site?.href, + inLanguage: 'de-DE', + publisher: { '@id': orgId }, +}; +const ldJson = { '@context': 'https://schema.org', '@graph': [orgData, siteData, ...schema] }; --- @@ -41,6 +68,7 @@ const orgData = { {title} · Larpaso + {noindex && } @@ -60,7 +88,7 @@ const orgData = {