2024-08-04 22:33:37 +00:00
|
|
|
{{- $url := "https://raw.githubusercontent.com/ai-robots-txt/ai.robots.txt/main/robots.json" -}}
|
|
|
|
{{- with resources.GetRemote $url -}}
|
|
|
|
{{- with .Err -}}
|
|
|
|
{{- errorf "%s" . -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $robots := unmarshal .Content -}}
|
2024-08-06 02:01:14 +00:00
|
|
|
{{- range $botname, $_ := $robots }}
|
2024-08-04 22:33:37 +00:00
|
|
|
{{- printf "User-agent: %s\n" $botname }}
|
|
|
|
{{- end }}
|
|
|
|
{{- printf "Disallow: /\n" }}
|
|
|
|
{{- printf "\n# (bad bots bundled by https://github.com/ai-robots-txt/ai.robots.txt)" }}
|
|
|
|
{{- end -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- errorf "Unable to get remote resource %q" $url -}}
|
|
|
|
{{- end -}}
|