From 08b39653ba46361b108b1a65313db054a727344d Mon Sep 17 00:00:00 2001 From: juanatsap Date: Thu, 9 Apr 2026 12:24:06 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20SEO=20=E2=80=94=20prevent=20Google=20fro?= =?UTF-8?q?m=20indexing=20/text=20instead=20of=20main=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add X-Robots-Tag: noindex, nofollow header to /text endpoint - Add Link: canonical header pointing to HTML version - Add Disallow: /text to robots.txt - Update sitemap.xml lastmod to 2026-04-09 --- internal/handlers/cv_text.go | 2 ++ static/robots.txt | 4 ++++ static/sitemap.xml | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/internal/handlers/cv_text.go b/internal/handlers/cv_text.go index 3c1d521..6ba76d5 100644 --- a/internal/handlers/cv_text.go +++ b/internal/handlers/cv_text.go @@ -152,6 +152,8 @@ func (h *CVHandler) PlainText(w http.ResponseWriter, r *http.Request) { // Set response headers w.Header().Set(c.HeaderContentType, c.ContentTypePlainText) w.Header().Set(c.HeaderXContentTypeOpts, c.NoSniff) + w.Header().Set("X-Robots-Tag", "noindex, nofollow") + w.Header().Set("Link", `; rel="canonical"`) // Check if download is requested if r.URL.Query().Get("download") == "true" { diff --git a/static/robots.txt b/static/robots.txt index 50a2b32..43e6c22 100644 --- a/static/robots.txt +++ b/static/robots.txt @@ -13,6 +13,10 @@ Disallow: /api/internal/ Disallow: /.git/ Disallow: /.env +# Plain text version — prevent duplicate content indexing +# Canonical HTML version at / should be indexed instead +Disallow: /text + # ============================================================================= # SITEMAPS & AI CONTENT # ============================================================================= diff --git a/static/sitemap.xml b/static/sitemap.xml index 52fddd3..05c8398 100644 --- a/static/sitemap.xml +++ b/static/sitemap.xml @@ -5,7 +5,7 @@ https://juan.andres.morenorub.io/?lang=en - 2024-10-18 + 2026-04-09 monthly 1.0 @@ -15,7 +15,7 @@ https://juan.andres.morenorub.io/?lang=es - 2024-10-18 + 2026-04-09 monthly 1.0 @@ -25,7 +25,7 @@ https://juan.andres.morenorub.io/ - 2024-10-18 + 2026-04-09 monthly 0.9 @@ -33,7 +33,7 @@ https://juan.andres.morenorub.io/health - 2024-10-18 + 2026-04-09 daily 0.3