mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-25 08:22:19 +00:00
rss: alternate approach to image embeds
This commit is contained in:
parent
c8f4a80c27
commit
d86964f33f
1 changed files with 4 additions and 3 deletions
|
@ -10,7 +10,7 @@
|
||||||
{{- if ge $limit 1 -}}
|
{{- if ge $limit 1 -}}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- $pages = $pages | first $limit -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
<!-- {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} -->
|
||||||
<rss version="2.0"
|
<rss version="2.0"
|
||||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
||||||
|
@ -41,8 +41,9 @@
|
||||||
{{ range (.GetTerms "tags") }}
|
{{ range (.GetTerms "tags") }}
|
||||||
<category>{{ .LinkTitle }}</category>{{ end }}
|
<category>{{ .LinkTitle }}</category>{{ end }}
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<description>{{ "<![CDATA[" | safeHTML }} {{ .Summary }}]]></description>
|
{{- $content := replaceRE "a href=\"(#.*?)\"" (printf "%s%s%s" "a href=\"" .Permalink "$1\"") .Content -}}
|
||||||
<content:encoded>{{ "<![CDATA[" | safeHTML }} {{ replaceRE "img src=\"(.*?)\"" (printf "%s%s%s" "img src=\"" .Permalink "$1\"") .Content }}]]></content:encoded>
|
{{- $content = replaceRE "img src=\"(.*?)\"" (printf "%s%s%s" "img src=\"" .Permalink "$1\"") $content -}}
|
||||||
|
<description>{{ $content | html }}</description>
|
||||||
</item>
|
</item>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</channel>
|
</channel>
|
||||||
|
|
Loading…
Reference in a new issue