{{- $url := .Get "url" }} {{- $limit := or (.Get "limit") (.Get "pagerSize")}} {{- $data := dict }} {{- with resources.GetRemote $url }} {{- $data = . | transform.Unmarshal }} {{- end }} {{- with $data }} {{- $version := index $data "-version" }} {{- if not $version }}

{{- printf "Unable to get remote resource %q" $url }}

{{- else if eq $version "2.0" }} {{- $siteTitle := .channel.title }} {{- $siteDescription := .channel.description }} {{- $siteLink := .channel.link }} {{- $siteImage := .channel.image.url }} {{- $siteLanguage := .channel.language }} {{- $buildDate := .channel.lastBuildDate }} {{- with .channel.item }}
{{- $pagerSize := or $limit 10 }} {{- range $index, $channelItem := . | first $pagerSize }} {{- $author := or .author .creator }} {{- $title := .title }} {{- $description := or .description .summary }} {{- $link := .link }} {{- $date := .pubDate }} {{- $category := .category }} {{- $type := index .enclosure "-type" }} {{- $url := index .enclosure "-url" }} {{- if $index }}{{- end }}
{{- with $author }}{{ . }} {{ end }} {{- with $date }}
{{ end }}

{{ $title }}

{{ $hasCover := or (eq $type "image/jpeg") .coverImage }}
{{- if $hasCover }} {{- if .coverImage }} {{- $url = .coverImage }} {{- end }} {{ .title }} {{- end }}
{{ $description | safeHTML }}
{{- end }}
{{- end }} {{- end }} {{- end }}