From f945c30bd5cb057b509c5d5cfae21f792e7fdc8f Mon Sep 17 00:00:00 2001 From: danix Date: Tue, 14 Feb 2023 18:00:30 +0100 Subject: [PATCH] added rss template. General cleanup of the theme. --- assets/sass/components/_image.scss | 4 +++ assets/sass/libs/_my-mixins.scss | 9 +++++++ layouts/_default/rss.xml | 39 ++++++++++++++++++++++++++++++ layouts/home-baseof.html | 2 +- layouts/home.html | 8 +++--- layouts/partials/footer.html | 2 +- layouts/partials/head.html | 4 +++ 7 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 layouts/_default/rss.xml diff --git a/assets/sass/components/_image.scss b/assets/sass/components/_image.scss index 1cefb63..b77a874 100644 --- a/assets/sass/components/_image.scss +++ b/assets/sass/components/_image.scss @@ -59,4 +59,8 @@ margin: (_size(element-margin) * 0.75) 0; } } + } + + .circle > img { + @include circle(200px, "block") } \ No newline at end of file diff --git a/assets/sass/libs/_my-mixins.scss b/assets/sass/libs/_my-mixins.scss index a901a45..9d0b0ce 100644 --- a/assets/sass/libs/_my-mixins.scss +++ b/assets/sass/libs/_my-mixins.scss @@ -157,3 +157,12 @@ } } } + +@mixin circle($size, $display) { + width: $size; + height: $size; + display: $display; + -webkit-border-radius: $size/2; + -moz-border-radius: $size/2; + border-radius: $size/2; +} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..3663b47 --- /dev/null +++ b/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 "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Page.Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Summary | html }} + + {{ end }} + + diff --git a/layouts/home-baseof.html b/layouts/home-baseof.html index 62fc743..2335867 100644 --- a/layouts/home-baseof.html +++ b/layouts/home-baseof.html @@ -2,7 +2,7 @@ {{- partial "head.html" . -}} - +
{{- partial "header.html" . -}}