{{- $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 -}} {{- range $botname, $_ := $robots }} {{- 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 -}}