From 90231f73ba46fde3cc7c76dd15eabab06c541e0a Mon Sep 17 00:00:00 2001 From: Aroy-Art <Aroy-Art@pm.me> Date: Sun, 25 May 2025 23:43:37 +0200 Subject: [PATCH] Add: basic robot.txt template with config options --- layouts/_default/robots.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 layouts/_default/robots.txt diff --git a/layouts/_default/robots.txt b/layouts/_default/robots.txt new file mode 100644 index 0000000..0c84f5f --- /dev/null +++ b/layouts/_default/robots.txt @@ -0,0 +1,20 @@ +User-agent: * +{{ if .Site.Params.robots.disallow_all }} +Disallow: / +{{ else if .Site.Params.robots.allow_all }} +Disallow: +{{ else }} +{{ range .Site.Params.robots.disallowed_paths }} +Disallow: {{ . }} +{{ end }} +{{ end }} + +{{ range .Site.Params.robots.blocked_bots }} +User-agent: {{ . }} +Disallow: / +{{ end }} + +# Add Sitemap if you have one +{{ if .Site.Params.robots.sitemap_enabled | default true }} +Sitemap: {{ .Site.BaseURL | absURL }}sitemap.xml +{{ end }}