diff options
Diffstat (limited to 'themes/flamingo/layouts')
-rw-r--r-- | themes/flamingo/layouts/_default/baseof.html | 3 | ||||
-rw-r--r-- | themes/flamingo/layouts/_default/rss.xml | 39 | ||||
-rw-r--r-- | themes/flamingo/layouts/_default/single.html | 5 | ||||
-rw-r--r-- | themes/flamingo/layouts/_default/summary.html | 17 | ||||
-rw-r--r-- | themes/flamingo/layouts/partials/footer.html | 7 | ||||
-rw-r--r-- | themes/flamingo/layouts/partials/header.html | 1 |
6 files changed, 55 insertions, 17 deletions
diff --git a/themes/flamingo/layouts/_default/baseof.html b/themes/flamingo/layouts/_default/baseof.html index 86a82c1..3475f47 100644 --- a/themes/flamingo/layouts/_default/baseof.html +++ b/themes/flamingo/layouts/_default/baseof.html @@ -23,6 +23,9 @@ <!-- Meta tags --> {{ partial "meta" . }} + {{ if .RSSLink }} + <link href="{{ .RSSLink }}" rel="alternate" type="application/atom+xml" title="{{ .Site.Title }}" /> + {{ end }} </head> <body> <div class="layout"> diff --git a/themes/flamingo/layouts/_default/rss.xml b/themes/flamingo/layouts/_default/rss.xml new file mode 100644 index 0000000..ea5fd95 --- /dev/null +++ b/themes/flamingo/layouts/_default/rss.xml @@ -0,0 +1,39 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<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> diff --git a/themes/flamingo/layouts/_default/single.html b/themes/flamingo/layouts/_default/single.html index 99ec989..6261b4b 100644 --- a/themes/flamingo/layouts/_default/single.html +++ b/themes/flamingo/layouts/_default/single.html @@ -4,7 +4,10 @@ <h1>{{ .Title }}</h1> {{ if .Date }} - <time>{{ .Date.Format "Jan 02, 2006" }}</time> + <time>Created At: {{ .Date.Format "02 Jan 2006" }}</time></br> + {{ end }} + {{ if .Lastmod }} + <time>Last Modified: {{ .Lastmod.Format "02 Jan 2006"}}</time> {{ end }} {{ partial "tagbar.html" }} diff --git a/themes/flamingo/layouts/_default/summary.html b/themes/flamingo/layouts/_default/summary.html index e010313..519da2b 100644 --- a/themes/flamingo/layouts/_default/summary.html +++ b/themes/flamingo/layouts/_default/summary.html @@ -2,22 +2,7 @@ <div class="post-title"> <a href="{{ .Permalink }}">{{ .Title }}</a> </div> - - <!-- Add tags --> - <!-- {{ range .Params.tags }} - <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a> - {{ end }} - --> - <span className="date-label"> - {{ .Date.Format "2" }}{{ if in (slice 1 21 31) .Date.Day}}st{{ else if in (slice 2 22) .Date.Day}}nd{{ else if in (slice 3 23) .Date.Day}}rd{{ else }}th{{ end }} {{ .Date.Format "Jan, 2006" }} + {{ .Date.Format "02 Jan 2006" }} </span> - - <!-- <div> - {{ .Summary }} - {{ if .Truncated }} - <a href="{{ .Permalink }}">Read more...</a> - {{ end }} - </div> - --> </article> diff --git a/themes/flamingo/layouts/partials/footer.html b/themes/flamingo/layouts/partials/footer.html index 4476494..5a3724b 100644 --- a/themes/flamingo/layouts/partials/footer.html +++ b/themes/flamingo/layouts/partials/footer.html @@ -5,6 +5,13 @@ <li><a href="/about/">about</a></li> <li><a href="/logs/">logs</a></li> <li><a href="/privacy/">privacy</a></li> + <li> <a + class="brand-icon" + target="_blank" + href="/index.xml"> + <i class="fab fa-rss"></i> + </a> + </li> </ul> </nav> </div> diff --git a/themes/flamingo/layouts/partials/header.html b/themes/flamingo/layouts/partials/header.html index 8f26fb4..478c6f1 100644 --- a/themes/flamingo/layouts/partials/header.html +++ b/themes/flamingo/layouts/partials/header.html @@ -1,4 +1,5 @@ <header> + <!-- title wrapper --> <div class="title-wrapper"> <a href="/"> |