From 257182f2f1ab8793aa04fafedb67e8635f49a1ff Mon Sep 17 00:00:00 2001 From: Nicolas Martignoni Date: Sun, 10 Sep 2023 13:06:24 +0200 Subject: [PATCH] Fix indexation error - Ref: https://support.google.com/webmasters/answer/7440203#indexed_though_blocked_by_robots_txt --- layouts/_default/baseof.html | 4 ++++ layouts/_default/robots.txt | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 900c9c8..0aa9a70 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,7 +5,11 @@ {{ hugo.Generator }} + {{ if .Params.robotsdisallow -}} + + {{- else -}} + {{- end }} diff --git a/layouts/_default/robots.txt b/layouts/_default/robots.txt index e1d1191..423624a 100644 --- a/layouts/_default/robots.txt +++ b/layouts/_default/robots.txt @@ -1,9 +1,4 @@ User-agent: * -{{ range site.Home.AllTranslations -}} -{{ range where .RegularPages "Params.robotsdisallow" true }} -Disallow: {{ .RelPermalink }} -{{- end -}} -{{- end }} Sitemap: {{ "sitemap.xml" | absURL -}} {{- if site.IsMultiLingual }}