From 44d3a27d6619b8bb734af5004df515e7781aba21 Mon Sep 17 00:00:00 2001 From: mms Date: Tue, 21 May 2024 19:55:20 +0200 Subject: fix: urls and layout: --- themes/sapka-2024/layouts/_default/list.txt | 7 +++ themes/sapka-2024/layouts/_default/page.html | 1 + themes/sapka-2024/layouts/_default/rss.xml | 73 +++++++++++++++++++++++++ themes/sapka-2024/layouts/_default/section.html | 26 +++++++++ 4 files changed, 107 insertions(+) create mode 100644 themes/sapka-2024/layouts/_default/list.txt create mode 100644 themes/sapka-2024/layouts/_default/rss.xml (limited to 'themes/sapka-2024/layouts/_default') diff --git a/themes/sapka-2024/layouts/_default/list.txt b/themes/sapka-2024/layouts/_default/list.txt new file mode 100644 index 0000000..430a2d2 --- /dev/null +++ b/themes/sapka-2024/layouts/_default/list.txt @@ -0,0 +1,7 @@ +{{- range .Pages.GroupBy "Section" }} + {{- with $.Site.GetPage "section" .Key }} + {{- range .Pages }} + {{ .Permalink }} + {{- end }} + {{- end }} +{{- end }} diff --git a/themes/sapka-2024/layouts/_default/page.html b/themes/sapka-2024/layouts/_default/page.html index e69de29..93f59a3 100644 --- a/themes/sapka-2024/layouts/_default/page.html +++ b/themes/sapka-2024/layouts/_default/page.html @@ -0,0 +1 @@ +aa aa diff --git a/themes/sapka-2024/layouts/_default/rss.xml b/themes/sapka-2024/layouts/_default/rss.xml new file mode 100644 index 0000000..99b99cd --- /dev/null +++ b/themes/sapka-2024/layouts/_default/rss.xml @@ -0,0 +1,73 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if $.IsHome }} +{{- $pages = $pctx.RegularPages}} +{{- else if $.IsSection }} +{{- $pages = $pctx.RegularPagesRecursive}} +{{- 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 + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages.ByPublishDate.Reverse}} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ crypto.MD5 .Date }} + {{ safeHTML "

Reply via email

]]>
+
+ {{- end }} +
+
diff --git a/themes/sapka-2024/layouts/_default/section.html b/themes/sapka-2024/layouts/_default/section.html index e69de29..2b045b8 100644 --- a/themes/sapka-2024/layouts/_default/section.html +++ b/themes/sapka-2024/layouts/_default/section.html @@ -0,0 +1,26 @@ +{{ define "main" }} + +{{if .Page.Content}} + {{ .Page.Content }} + {{- if .Params.primary_menu }} + {{ partial "single/bottom_nav.html" (dict "menuID" .Page.Params.primary_menu "page" .) }} + {{- end }} + + {{ partial "single/dates.html" . }} +{{ else }} + + {{ if in .Page.Params.Categories "blog" }} + {{ partial "partials/blog_index.html" . }} + {{ else if in .Page.Params.Categories "article" }} + {{ partial "partials/article_index.html" . }} + {{ else }} + +

Articles

+ {{ range .Data.Pages }} + {{ partial "partials/article_list_item.html" . }} + {{ end }} + + {{ end }} +{{end}} + +{{ end }} -- cgit v1.2.3