Browse Source

enable full-text RSS and increase summary size

master
jk 5 years ago
parent
commit
92db40e1f3
  1. 2
      config.toml
  2. 26
      layouts/_default/rss.xml
  3. 3
      themes/anatole/layouts/index.html
  4. 2
      themes/anatole/static/css/style.css

2
config.toml

@ -2,7 +2,7 @@ baseURL = "https://jk.nipponalba.scot"
languageCode = "en-gb" languageCode = "en-gb"
title = "JK's homepage" title = "JK's homepage"
theme="anatole" theme="anatole"
summarylength=10
summarylength=30
enableEmoji=true enableEmoji=true
defaultContentLanguage="en" defaultContentLanguage="en"

26
layouts/_default/rss.xml

@ -0,0 +1,26 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .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 }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{ with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end }}
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
</item>
{{ end }}
</channel>
</rss>

3
themes/anatole/layouts/index.html

@ -1,7 +1,8 @@
{{ define "main" }} {{ define "main" }}
<div class="about animated fadeInDown"> <div class="about animated fadeInDown">
{{ range first 8 .Site.RegularPages }}
<h1>Recent posts</h1>
{{ range first 5 .Site.RegularPages }}
{{ if eq .Type "post"}} {{ if eq .Type "post"}}
<div> <div>
<h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3> <h3><a href="{{ .RelPermalink }}">{{ .Title }}</a></h3>

2
themes/anatole/static/css/style.css

@ -74,7 +74,7 @@ body {
.main, .content { .main, .content {
background: var(--bg-colour); background: var(--bg-colour);
color: var(--text-colour); color: var(--text-colour);
height:100%;
height:95%;
display:block; display:block;
} }
p { p {