Removing graphs from RSS feed
This commit is contained in:
parent
d289809cd1
commit
3eab65c59b
1 changed files with 18 additions and 17 deletions
|
|
@ -6,7 +6,6 @@
|
|||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $authorName := "" }}
|
||||
{{- with site.Params.author }}
|
||||
{{- if reflect.IsMap . }}
|
||||
|
|
@ -17,7 +16,6 @@
|
|||
{{- $authorName = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- $pctx := . }}
|
||||
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
|
||||
{{- $pages := slice }}
|
||||
|
|
@ -42,13 +40,16 @@
|
|||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{- end }}
|
||||
{{- range $pages }}
|
||||
{{- $content := .Content }}
|
||||
{{- /* Remove graph containers with all their content including canvas and script tags */ -}}
|
||||
{{- $content = replaceRE `(?s)<div class="graph-container"[^>]*>.*?</div>\s*<script>.*?</script>` "<p><em>[Interactive graph not available in RSS - please visit the full post to view the charts]</em></p>" $content }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | transform.XMLEscape | safeHTML }}</description>
|
||||
<description>{{ $content | transform.XMLEscape }}</description>
|
||||
</item>
|
||||
{{- end }}
|
||||
</channel>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue