diff options
author | gabrielgio <gabriel.giovanini@pm.me> | 2020-07-12 00:59:51 +0200 |
---|---|---|
committer | gabrielgio <gabriel.giovanini@pm.me> | 2020-07-12 00:59:51 +0200 |
commit | bf64e61e1da92a829ae172cde608371a3335b602 (patch) | |
tree | 6148e3271c33ccd336cb12fb8b976798530f651e /themes/flamingo/layouts/_default | |
parent | a42f79ec30d915b45793d7d3c6964845bd5f4946 (diff) | |
download | gabrielgio.me-bf64e61e1da92a829ae172cde608371a3335b602.tar.gz gabrielgio.me-bf64e61e1da92a829ae172cde608371a3335b602.tar.bz2 gabrielgio.me-bf64e61e1da92a829ae172cde608371a3335b602.zip |
Adds two pages from previous jekyll project
Diffstat (limited to 'themes/flamingo/layouts/_default')
-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 |
4 files changed, 47 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> |