Commit e77eddb8 authored by Sylvain Kerkour's avatar Sylvain Kerkour

feeds (RSS + JSON)

parent 656792a4
......@@ -2,7 +2,11 @@ baseURL = "https://fatalentropy.com"
languageCode = "en-us"
title = "Fatal Entropy"
disableHugoGeneratorInject = true
enableGitInfo = true
[author]
name = "Sylvain Kerkour"
email = "[email protected]"
[markup.goldmark.renderer]
unsafe= true
......@@ -20,3 +24,16 @@ disableHugoGeneratorInject = true
"""
git = "https://gitlab.com/bloom42/blog"
obfuscatedEmail = '<n uers="znvygb:[email protected]">[email protected]</n>'
[outputFormats.jsonfeed]
mediaType = "application/json"
baseName = "feed"
isPlainText = true
[outputFormats.RSS]
mediatype = "application/rss"
baseName = "feed"
[outputs]
home = ["HTML", "RSS", "jsonfeed"]
{
"version": "https://jsonfeed.org/version/1",
"title": "{{ .Site.Title }}",
"home_page_url": "{{ .Permalink }}",
"feed_url": "{{ .Permalink }}feed.json",
"description": "{{ .Site.Params.Description }}",
"author": {
"contact": "{{ .Site.Author.email }}",
"name": "{{ .Site.Author.name }}"
},
"items": [ {{ range $index, $item := (where (where .Site.Pages "Type" "post") "IsPage" true) }}{{if $index}}, {{end}}
{
"id": "{{ .Permalink }}",
"title": "{{ .Title }}",
"url": "{{ if isset .Params "redirect" }}{{ .Params.redirect }}{{ else }}{{ .Permalink }}{{ end }}",
"content_html": "{{ replace .Content "\n" "\\n" | replaceRE "\"" "\\\"" | replaceRE "\t" "\\t"}}{{ if isset .Params "redirect" }}<p><a href=\"{{ .Permalink }}\">Read on site</a></p>{{ end }}",
"summary": "{{ replace .Summary "\n" "\\n" | replaceRE "\"" "\\\"" }}",
{{ range $taxonomy := .Params.categories }}"banner_image": "https://ig.nore.me/img/categories/category-{{ $taxonomy | urlize }}-full.jpg",{{ end }}
{{ if isset .Params "ogimage" }}"image": "{{ .Params.ogimage }}",{{ end }}
"date_published": "{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}",
"date_modified": "{{ .Lastmod.Format "2006-01-02T15:04:05Z07:00" }}"
}{{ end }}
]
}
......@@ -5,10 +5,9 @@
{{ .Site.Title }}{{ end }}
</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}}
{{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<description>{{ .Site.Params.Description }}</description>
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>
{{end}}
{{ with .Site.Author.email }}
......@@ -26,6 +25,7 @@
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<lastUpdate>{{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastUpdate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
......
......@@ -43,6 +43,11 @@
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ end }}
{{ with .Site.GetPage "/" }}
{{ with .OutputFormats.Get "jsonfeed" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ end }}
<!-- css -->
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | relURL }}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment