From 7d8ad46d1113b33f99da80a55eb0e7370ef6063d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asger=20Geel=20Weirs=C3=B8e?= Date: Sun, 27 Sep 2026 07:57:01 +0200 Subject: [PATCH] =?UTF-8?q?seo:=20tynde=20tag-sider=20noindex=20+=20ud=20a?= =?UTF-8?q?f=20sitemap,=20for=C3=A6ldrel=C3=B8se=20sider=20linket?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - tag-siderne (/tags og /tags/*) får "noindex, follow" og udelades af sitemap'et: 21 lister med 1-2 indlæg hver trak helhedsindtrykket ned - /peppol er kun en omdirigering til /nemhandel: noindex og ud af sitemap'et - /profiler og /ubl kunne kun nås via Cmd/Ctrl+K-paletten (JavaScript, som Google ikke følger); nu kort på forsiden under "Mere end et CV" Sitemap: 44 -> 22 URL'er, alle nås inden for 2 klik fra forsiden. Claude-Session: https://claude.ai/code/session_012LCTmU2ewo8tnM1dByYAoG --- astro.config.mjs | 6 ++++++ src/components/Head.astro | 7 +++++-- src/layouts/Base.astro | 5 +++-- src/pages/index.astro | 2 ++ src/pages/peppol.astro | 1 + src/pages/tags/[tag].astro | 2 +- src/pages/tags/index.astro | 2 +- 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 629a00c..716ad0a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -140,6 +140,12 @@ export default defineConfig({ sitemap({ changefreq: 'weekly', priority: 0.7, + // Tag-siderne er noindex (tynde lister), så de hører heller ikke i sitemap'et. + // /peppol er kun en omdirigering til /nemhandel og skal ikke indekseres. + filter: (page) => { + const p = new URL(page).pathname; + return !p.startsWith('/tags') && !p.startsWith('/peppol'); + }, serialize(item) { const pathname = new URL(item.url).pathname; if (pathname === '/') item.priority = 1.0; diff --git a/src/components/Head.astro b/src/components/Head.astro index 48285b9..1df2d23 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -11,10 +11,13 @@ interface Props { modifiedTime?: string; tags?: string[]; jsonLd?: unknown[]; + // Tynde oversigtssider (fx tags med 1-2 indlæg) skal ikke i Googles indeks, + // men links fra dem skal stadig følges. + noindex?: boolean; } const { title, description, image, type = 'website', - publishedTime, modifiedTime, tags = [], jsonLd = [], + publishedTime, modifiedTime, tags = [], jsonLd = [], noindex = false, } = Astro.props; const pageTitle = title ? `${title} · ${SITE.name}` : `${SITE.title} · Datalog & Technical Solution Architect`; @@ -33,7 +36,7 @@ const graphs = [baseGraph, ...jsonLd]; - + diff --git a/src/layouts/Base.astro b/src/layouts/Base.astro index 1d72be3..0b82aed 100644 --- a/src/layouts/Base.astro +++ b/src/layouts/Base.astro @@ -16,8 +16,9 @@ interface Props { modifiedTime?: string; tags?: string[]; jsonLd?: unknown[]; + noindex?: boolean; } -const { title, description, image, type, publishedTime, modifiedTime, tags, jsonLd } = Astro.props; +const { title, description, image, type, publishedTime, modifiedTime, tags, jsonLd, noindex } = Astro.props; --- - + diff --git a/src/pages/index.astro b/src/pages/index.astro index 75f0aad..3e4cc60 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -88,6 +88,8 @@ const jsonLd = [profilePage, faqPage(faqs)]; { href: '/chat', title: 'Spørg mit CV', desc: 'En lille AI der har læst mit CV og svarer på spørgsmål om mig. Prøv den af.' }, { href: '/status', title: 'Homelab-status', desc: 'Live driftsstatus for de offentlige dele af mit homelab. Self-hosted, selvfølgelig.' }, { href: '/now', title: 'Now', desc: 'Hvad jeg roder med lige nu, plus et aktivitets-heatmap fra min egen Gitea.' }, + { href: '/profiler', title: 'Profil-opslag', desc: 'Søgbart opslag over Nemhandel OIOUBL- og Peppol BIS/PINT-profiler: id\'er, dokumenter og typisk brug.' }, + { href: '/ubl', title: 'UBL-tjek', desc: 'Træk en faktura ind og få profil, syntaks og EN 16931-status afkodet. Alt sker i browseren, filen forlader aldrig din maskine.' }, ].map((c) => (

{c.title} →

diff --git a/src/pages/peppol.astro b/src/pages/peppol.astro index d738ad9..ee53da5 100644 --- a/src/pages/peppol.astro +++ b/src/pages/peppol.astro @@ -5,6 +5,7 @@ + NemHandel-opslag diff --git a/src/pages/tags/[tag].astro b/src/pages/tags/[tag].astro index e2ad25e..4f4cce9 100644 --- a/src/pages/tags/[tag].astro +++ b/src/pages/tags/[tag].astro @@ -13,7 +13,7 @@ export async function getStaticPaths() { } const { posts, tag } = Astro.props; --- - +
← Alle tags

#{tag}

diff --git a/src/pages/tags/index.astro b/src/pages/tags/index.astro index b21c67c..ee86217 100644 --- a/src/pages/tags/index.astro +++ b/src/pages/tags/index.astro @@ -7,7 +7,7 @@ const counts = new Map(); for (const p of posts) for (const t of p.data.tags) counts.set(t, (counts.get(t) ?? 0) + 1); const tags = [...counts.entries()].sort((a, b) => b[1] - a[1]); --- - +

Tags

{tags.map(([t, n]) => (