- Create robots.txt template with Sitemap directive and JSON search index exclusions
- Add canonical link and hreflang alternates (it, en, x-default) to all pages
- Uses Hugo built-ins (.Permalink, .AllTranslations) for production-correct URLs
- All pages now signal canonical URL and language variants to search engines
Co-Authored-By: Claude Haiku 4.5 <redacted>
{{ with .Site.Params.twitterHandle }}
<meta name="twitter:site" content="@{{ . }}">
{{ end }}
+
+{{/* SEO: Self-referencing canonical */}}
+<link rel="canonical" href="{{ .Permalink }}">
+
+{{/* SEO: hreflang alternates for all language variants */}}
+{{ range .AllTranslations }}
+<link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}">
+{{ end }}
+{{/* x-default: EN version (served at root /) */}}
+{{ range .AllTranslations }}
+ {{ if eq .Language.Lang "en" }}
+<link rel="alternate" hreflang="x-default" href="{{ .Permalink }}">
+ {{ end }}
+{{ end }}
--- /dev/null
+User-agent: *
+Disallow: /search-index.json
+Disallow: /it/search-index.json
+
+Sitemap: {{ .Site.BaseURL }}sitemap.xml