Skip to content

Commit f2e9b2e

Browse files
committed
feat: add translations to feed
1 parent 0ae1114 commit f2e9b2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

themes/ropensci/layouts/blog/list.json.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,16 @@
3636
"content_html": {{ .Content | replaceRE "\n" "" | jsonify }},
3737
"url": "{{ .Permalink }}",
3838
"date_published": "{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}",
39-
{{ with .Params.crossposts }}
40-
"_relationships": [{{ range $index, $element := . }}
39+
{{ if (or (isset .Params "crossposts") .IsTranslated) }}
40+
"_relationships": [ {{ if (isset .Params "crossposts") }}{{ range $index, $element := .Params.crossposts }}{{ if $index }},{{end}}
4141
{
4242
"url": "{{ .url }}",
4343
"title": "{{ .name }}",
44-
"relation": "IsIdenticalTo"}{{ if $index}},{{end}}{{ end }} ]
44+
"relation": "IsIdenticalTo"}{{ end }}{{ end }} {{ if .IsTranslated }}{{ if (isset .Params "crossposts") }},{{ end }}{{ range $index, $element := .Translations }}{{ if $index }},{{end}}
45+
{
46+
"url": "{{ .Permalink }}",
47+
"title": "{{ .Title }}",
48+
"relation": "IsTranslationOf"}{{ end }}{{ end }}]
4549
,{{ end }}
4650
"date_modified": "{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}"
4751
}

0 commit comments

Comments
 (0)