You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
603 B
HTML

{{- $method := .Get "method" | default "get" -}}
{{- $url := .Get 0 | default (.Get "url") -}}
{{- if not $url -}}
{{- errorf "layouts/shortcodes/paige/request.html: no url" -}}
{{- end -}}
{{- with resources.GetRemote $url (dict "method" $method) -}}
{{- with .Err -}}
{{- errorf "layouts/shortcodes/paige/request.html: cannot request remote resource %q: %v" $url . -}}
{{- else -}}
{{- strings.TrimRight "\f\n\r\t\v " .Content -}}
{{- end -}}
{{- else -}}
{{- errorf "layouts/shortcodes/paige/request.html: cannot request remote resource %q" $url -}}
{{- end -}}