From ec4ef9f53368052b0e4175e77606b53781bf98bf Mon Sep 17 00:00:00 2001
From: drkhsh <me@drkhsh.at>
Date: Sun, 26 Jan 2025 13:58:15 +0100
Subject: [PATCH] use hugo template for robots.txt

---
 hugo.toml                      | 2 +-
 {static => layouts}/robots.txt | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
 rename {static => layouts}/robots.txt (89%)

diff --git a/hugo.toml b/hugo.toml
index eeb1069..a4d3656 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -3,7 +3,7 @@ languageCode = 'de-AT'
 title = 'IT-Syndikat'
 theme = "mainroad"
 pluralizelisttitles = false   # removes the automatically appended "s" on sidebar entries
-enableRobotsTXT = false
+enableRobotsTXT = true
 
 defaultContentLanguage = 'de'
 defaultContentLanguageInSubdir = false
diff --git a/static/robots.txt b/layouts/robots.txt
similarity index 89%
rename from static/robots.txt
rename to layouts/robots.txt
index a44159e..eb070c4 100644
--- a/static/robots.txt
+++ b/layouts/robots.txt
@@ -44,3 +44,9 @@ User-agent: VelenPublicWebCrawler
 User-agent: Webzio-Extended
 User-agent: YouBot
 Disallow: /
+
+{{ range where .Data.Pages "Params.robotsdisallow" true }}
+Disallow: {{ .RelPermalink }}
+{{ end }}
+
+Sitemap: {{ "sitemap.xml" | absLangURL }}