Skip to content

Commit f4aaf8c

Browse files
committed
fix site rendering
Signed-off-by: Ignasi Barrera <ignasi@tetrate.io>
1 parent eb19a80 commit f4aaf8c

4 files changed

Lines changed: 58 additions & 3 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ check: ## Verify contents of last commit
208208
fi
209209

210210
site: ## Serve website content
211-
@git submodule update
211+
@git submodule update --init
212212
@cd site && $(gotool) hugo server --minify --disableFastRender --baseURL http://localhost:1313 --cleanDestinationDir -D
213213

214214
# define macros for multi-platform builds. these parse the filename being built

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
publish = "public"
44

55
[build.environment]
6-
HUGO_VERSION = "0.148.1"
6+
HUGO_VERSION = "0.161.0"
77

88
[context.production]
99
command = "git submodule update --init && hugo --gc --minify"

site/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
baseURL = "https://func-e.io/"
2-
languageCode = "en-us"
32
defaultContentLanguage = "en"
43
title = "func-e"
54
theme = "hello-friend"
@@ -10,6 +9,7 @@ theme = "hello-friend"
109

1110
[languages]
1211
[languages.en]
12+
locale = "en-us"
1313
[languages.en.params.logo]
1414
logoText = "func-e"
1515
[languages.en.menu]

site/layouts/_default/rss.xml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{{- $pctx := . -}}
2+
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
3+
{{- $pages := slice -}}
4+
{{- if or $.IsHome $.IsSection -}}
5+
{{- $pages = $pctx.RegularPages -}}
6+
{{- else -}}
7+
{{- $pages = $pctx.Pages -}}
8+
{{- end -}}
9+
{{- $limit := .Site.Config.Services.RSS.Limit -}}
10+
{{- if ge $limit 1 -}}
11+
{{- $pages = $pages | first $limit -}}
12+
{{- end -}}
13+
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
14+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
15+
<channel>
16+
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
17+
18+
{{ if .Site.Params.RssImage }}<image>
19+
<url>{{ printf "%s%s" .Permalink .Site.Params.RssImage }}</url>
20+
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
21+
<link>{{ .Permalink }}</link>
22+
</image>
23+
{{ end }}
24+
25+
<link>{{ .Permalink }}</link>
26+
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
27+
<generator>Hugo -- gohugo.io</generator>{{ with .Site.Language.Lang }}
28+
<language>{{.}}</language>{{end}}{{ with .Site.Copyright }}
29+
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
30+
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
31+
{{ with .OutputFormats.Get "RSS" }}
32+
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
33+
{{ end }}
34+
{{ range $pages }}
35+
<item>
36+
<title>{{ .Title }}</title>
37+
<link>{{ .Permalink }}</link>
38+
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
39+
<guid>{{ .Permalink }}</guid>
40+
<description>
41+
{{ if .Params.Cover }}
42+
{{ if .Params.UseRelativeCover }}{{ printf "<img src=\"%s%s\"/>" .Permalink .Params.Cover }}
43+
{{ else }}{{ printf "<img src=\"%s\"/>" (.Params.Cover | absURL) }}
44+
{{ end }}
45+
{{ else }}
46+
{{ $images := .Resources.ByType "image" }}
47+
{{ $featured := $images.GetMatch "{*featured*,*cover*,*thumbnail*}" }}
48+
{{ with $featured }}{{ printf "<img src=\"%s\"/>" .Permalink }}{{ end }}
49+
{{ end }}
50+
{{ if .Description }}{{ .Description | html }}{{ else }}{{ .Summary | html }}{{ end }}
51+
</description>
52+
</item>
53+
{{ end }}
54+
</channel>
55+
</rss>

0 commit comments

Comments
 (0)