Add: basic robot.txt template with config options

This commit is contained in:
Aroy-Art 2025-05-25 23:43:37 +02:00
parent 1aeb0e793c
commit 90231f73ba
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -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 }}