From afc1f095745a548ff400f187d53bc1570f02bcf2 Mon Sep 17 00:00:00 2001 From: Arne Rief Date: Sat, 13 Sep 2025 11:50:38 +0200 Subject: RSS full content, index renamed to home, fix text bugs --- README.md | 2 +- assets/js/main.js | 2 +- i18n/de.toml | 4 ++-- i18n/en.toml | 4 ++-- layouts/_default/home.html | 24 ++++++++++++++++++++++++ layouts/index.html | 25 ------------------------- layouts/rss.xml | 14 +++++++------- layouts/tags/list.html | 4 ++-- layouts/tags/term.html | 2 +- 9 files changed, 40 insertions(+), 41 deletions(-) create mode 100644 layouts/_default/home.html delete mode 100644 layouts/index.html diff --git a/README.md b/README.md index e12f415..b6c3f03 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ Editing the theme is simple: you only have to recreate the path and file that yo Here are three examples how to edit different aspects of the theme: ### Editing the Styling -Let's say you want to make changes to the stylesheet: in your project, create `assets/css/main.css`, then simply add the CSS rules you would like to have. They will be merge with the theme's stylesheet in the final build and be added to or overwrite the theme's styling rules. +Let's say you want to make changes to the stylesheet: in your project, create `assets/css/main.css`, then copy the CSS rules from the theme's stylesheet and add new rules or edit the existing ones for the changes you would like to have. ### Editing the HTML You would like to display information like reading time and word count for each post. For this you will have to create `layouts/_default/single.html` in your project, then copy the content of the corresponding file from the theme into your own file and add the HTML and Go code for displaying this information. A block for displaying reading time and word count is already implemented in `layouts/partials/list/post-card.html`, here you would have to re-create these directories and this file in your project and simply remove the comment around the block. diff --git a/assets/js/main.js b/assets/js/main.js index 6ba0f19..6eba32b 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -73,7 +73,7 @@ const link = li.querySelector(".post-card__link"); link.href = post.url; - link.tile = post.title; + link.innerHTML = post.title; const date = li.querySelector(".post-card__publish-date"); date.textContent = new Date(post.date).toLocaleDateString(); diff --git a/i18n/de.toml b/i18n/de.toml index fd13734..84f1a47 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -40,12 +40,12 @@ title = "Suche" [tags] - all = "Alle Schlagwörter" + all_title = "Alle Schlagwörter" + all_description= "Übersicht aller Themen auf dieser Webseite:" empty = "Keine Schlagwörter gefunden." name = "Schlagwörter" navigation = "Schlagwörter Navigation" no_posts = "Keine Artikel mit diesem Schlagwort gefunden." - overview_all = "Übersicht aller Themen auf dieser Webseite:" postcount_number = "{{ . }} Artikel gefunden" postcount_title = "Anzahl der Artikel" posts_list = "Artikel mit diesem Schlagwort:" diff --git a/i18n/en.toml b/i18n/en.toml index dc49095..fad6db0 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -40,12 +40,12 @@ title = "Search" [tags] - all = "All tags" + all_title = "All tags" + all_description = "Overview of all topics covered on this site:" empty = "No tags found." name = "Tags" navigation = "Tag navigation" no_posts = "No posts found with this tag." - overview_all = "Overview of all topics covered on this site:" postcount_number = "{{ . }} posts found" postcount_title = "Number of posts" posts_list = "Posts with this tag:" diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..031e3b5 --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,24 @@ +{{- define "main" }} +
+
+

+ {{ with .Title }}{{ . }}{{ else }}{{ site.Title | default "Welcome to my Blog!" }}{{ end }} +

+ {{- with site.Params.author.portrait }} + {{ . }} + {{- end }} + {{- with .Content }} +
+ {{ . }} +
+ {{- end }} +
+ + {{- partial "list/recent-posts.html" (dict + "count" 5 + "title" (lang.Translate "posts.recent" | default "Recent Articles") + "show_view_all" true + ) + -}} +
+{{- end }} diff --git a/layouts/index.html b/layouts/index.html deleted file mode 100644 index 85558ad..0000000 --- a/layouts/index.html +++ /dev/null @@ -1,25 +0,0 @@ -{{- /* HOMEPAGE */ -}} -{{- define "main" }} -
-
-

- {{ with .Title }}{{ . }}{{ else }}{{ site.Title | default "Welcome to my Blog!" }}{{ end }} -

- {{- with site.Params.author.portrait }} - {{ . }} - {{- end }} - {{- with .Content }} -
- {{ . }} -
- {{- end }} -
- - {{- partial "list/recent-posts.html" (dict - "count" 5 - "title" (lang.Translate "posts.recent" | default "Recent Articles") - "show_view_all" true - ) - -}} -
-{{- end }} diff --git a/layouts/rss.xml b/layouts/rss.xml index 4baaa59..9f70eb5 100644 --- a/layouts/rss.xml +++ b/layouts/rss.xml @@ -37,11 +37,11 @@ {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} Hugo - {{ 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 }} + {{ site.Language.LanguageCode }} + {{- with $authorName }}{{ . }}{{ end }} + {{- with $authorName }}{{ . }}{{ 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 }} @@ -50,9 +50,9 @@ {{ .Title }} {{ .Permalink }} {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{- with $authorName }}{{ . }}{{ end }} {{ .Permalink }} - {{ .Summary | transform.XMLEscape | safeHTML }} + {{ .Content | transform.XMLEscape | safeHTML }} {{- end }} diff --git a/layouts/tags/list.html b/layouts/tags/list.html index bfe9479..651f427 100644 --- a/layouts/tags/list.html +++ b/layouts/tags/list.html @@ -3,10 +3,10 @@

- {{ lang.Translate "tags.all" | default "All Tags" }} + {{ lang.Translate "tags.all_title" | default "All Tags" }}

- {{ lang.Translate "tags.overview_all" | default "Overview of all topics covered on this site." }} + {{ lang.Translate "tags.all_description" | default "Overview of all topics covered on this site." }}

diff --git a/layouts/tags/term.html b/layouts/tags/term.html index bbdc0bf..11dffa2 100644 --- a/layouts/tags/term.html +++ b/layouts/tags/term.html @@ -34,7 +34,7 @@ -- cgit v1.2.3