From 36150b5f88b2e513c6791b62aaf5eb3401d1c8a2 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 22 May 2022 20:01:48 +0200 Subject: Rework feeds to provide support for section --- layouts/_default/home.json.json | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 layouts/_default/home.json.json (limited to 'layouts/_default/home.json.json') diff --git a/layouts/_default/home.json.json b/layouts/_default/home.json.json deleted file mode 100644 index 6df1514..0000000 --- a/layouts/_default/home.json.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "https://jsonfeed.org/version/1.1", - "title": {{ (printf "%s JSON Feed" site.Title) | htmlUnescape | jsonify }}, - "home_page_url": {{ site.BaseURL | absURL | jsonify }}, - {{ with .OutputFormats.Get "JSON" }}"feed_url": {{.Permalink | absURL | jsonify }},{{ end }} - {{ with site.Params.description}}"description": {{site.Params.description | jsonify}},{{end}} - {{- $logo := resources.Get (site.Params.assets.logo | default "/img/open-graph-logo.png" ) }}{{ $logo = $logo.Resize "96x96" }} - "icon": {{ $logo.Permalink | jsonify }}, - "favicon": {{ $logo.Permalink | jsonify }}, - {{ with site.Author.name }}"authors": [ - { - "name": {{ . | jsonify }}{{ with site.Author.twitter }}, - "url": {{ (printf "https://twitter.com/%s" . ) | jsonify }}{{ end }} - } - ],{{ end }} - {{ with site.LanguageCode }}"language" : "{{ . }}",{{ end }}{{ $feedsize := site.Params.feedSize | default 25 }} - "items": [{{ $r := first $feedsize (where site.RegularPages.ByDate.Reverse "Type" "in" site.Params.mainSections) }} {{ range $i, $ := $r }}{{ if $i }},{{ end }} - { - "id": {{ $uuid := sha1 (.Permalink | absURL)}}"{{substr $uuid 0 8}}-{{substr $uuid 8 4}}-5{{substr $uuid 13 3}}-{{substr $uuid 16 1}}9{{substr $uuid 17 2}}-{{substr $uuid 21 12}}", - "url": {{ .Permalink | jsonify }}, - "title": {{ .Title | plainify | chomp | jsonify }}, - "summary": {{ .Summary | plainify | chomp | jsonify }}, - "date_published": {{ .PublishDate.UTC.Format site.Params.dateFormatFeed | jsonify }}{{ if ne .Date .Lastmod }}, - "date_modified" : {{ .Lastmod.UTC.Format site.Params.dateFormatFeed | jsonify }}{{ end }} - } - {{- end}} - ] -} -- cgit v1.2.3