feat(rss): полный текст и обложки в RSS-ленте, лимит 5 постов
- hugo.toml: ShowFullTextinRSS=true, [services.RSS] limit=5 - тема rDedInit rss.xml: prepend cover (figure.entry-cover, absURL) в content:encoded - openspec change rss-full-feed (план A реализован)
This commit is contained in:
@@ -74,7 +74,14 @@
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}}</description>
|
||||
{{- if and site.Params.ShowFullTextinRSS .Content }}
|
||||
<content:encoded>{{ (printf "<![CDATA[%s]]>" .Content) | safeHTML }}</content:encoded>
|
||||
{{- $page := . }}
|
||||
{{- $coverHtml := "" }}
|
||||
{{- with .Params.cover.image }}
|
||||
{{- $coverAbs := (path.Join $page.RelPermalink .) | absURL }}
|
||||
{{- $coverAlt := ($page.Params.cover.alt | default $page.Title) | htmlEscape }}
|
||||
{{- $coverHtml = printf "<figure class=\"entry-cover\"><img src=\"%s\" alt=\"%s\"></figure>" $coverAbs $coverAlt }}
|
||||
{{- end }}
|
||||
<content:encoded>{{ (printf "<![CDATA[%s%s]]>" $coverHtml .Content) | safeHTML }}</content:encoded>
|
||||
{{- end }}
|
||||
</item>
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user