mirror of
https://gitlab.com/ansol/web-ansol.org.git
synced 2024-11-22 06:11:30 +00:00
Martela RSS feed para mostrar pubDate de eventos
This commit is contained in:
parent
41689e4357
commit
2d44582e79
@ -80,6 +80,8 @@ privacy_pack = false
|
|||||||
# Show related content at the bottom of pages?
|
# Show related content at the bottom of pages?
|
||||||
show_related = {docs = true, page = false, post = true, project = true, publication = true, talk = true}
|
show_related = {docs = true, page = false, post = true, project = true, publication = true, talk = true}
|
||||||
|
|
||||||
|
main_sections = ["noticias", "eventos"]
|
||||||
|
|
||||||
############################
|
############################
|
||||||
## Contact details
|
## Contact details
|
||||||
##
|
##
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
{{- /* Upstream Hugo bug - RSS dates can be in future: https://github.com/gohugoio/hugo/issues/3918 */ -}}
|
{{- /* Upstream Hugo bug - RSS dates can be in future: https://github.com/gohugoio/hugo/issues/3918 */ -}}
|
||||||
{{- $page_context := cond .IsHome site . -}}
|
{{- $page_context := cond .IsHome site . -}}
|
||||||
{{- $pages := $page_context.RegularPages -}}
|
{{- $pages := $page_context.RegularPages -}}
|
||||||
|
{{- $pages = where $pages "Type" "in" site.Params.main_sections -}}
|
||||||
{{- $limit := site.Config.Services.RSS.Limit -}}
|
{{- $limit := site.Config.Services.RSS.Limit -}}
|
||||||
{{- if ge $limit 1 -}}
|
{{- if ge $limit 1 -}}
|
||||||
{{- $pages = $pages | first $limit -}}
|
{{- $pages = $pages | first $limit -}}
|
||||||
@ -30,7 +31,11 @@
|
|||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
|
{{- if eq .Type "noticias" }}
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
|
{{- else }}
|
||||||
|
<pubDate>{{ (time.AsTime .Params.metadata.event.date.start).Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
|
{{- end }}
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<description>{{ .Content | html }}</description>
|
<description>{{ .Content | html }}</description>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user