diff options
author | Martin Fischer <martin@push-f.com> | 2025-08-16 22:12:15 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2025-08-16 22:32:40 +0200 |
commit | b31a718136bfc81509533ecc09a3e7f3c27a4a6b (patch) | |
tree | ebdb97d8c6074d485853bb030d93e9d4bd714b43 | |
parent | 38871393ba1658bd0b8aac4f88c4159271502d63 (diff) |
-rw-r--r-- | README.md | 20 | ||||
-rw-r--r-- | layouts/partials/head.html | 19 |
2 files changed, 36 insertions, 3 deletions
@@ -21,6 +21,26 @@ Tastefejl is a fork of the [Typo] Hugo theme, with the following changes: * Removed the copy buttons for code blocks because they could obscure the code and also behaved wrongly on horizontal scrolling. +* Fixed that individual blog posts didn't have `rel=alternate` links. `homeCollection` is now also linked as the RSS feed of the home page. + Tip: Hugo by default also generates an RSS entry for the home page disable this in `hugo.toml` with: + + ```toml + [outputs] + home = ['html'] + section = ['html'] + taxonomy = ['html'] + term = ['html'] + ``` + + And then reenable this in `content/posts/_index.md` for posts with: + + ``` + +++ + title = "Posts" + outputs = ["HTML", "RSS"] + +++ + ``` + * Removed [Simple Icons] because I don't want to plaster brands on my website and at one point a 50MB .html file was committed (I filtered the git history to reduce the size of the repository.) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e437156..55a2077 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,9 +17,22 @@ <link rel="apple-touch-icon" sizes="180x180" href="{{ urls.JoinPath $faviconPath "apple-touch-icon.png" }}"> {{ end }} -{{ with .OutputFormats.Get "rss" -}} -{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }} -{{ end }} +{{- define "outputFormats" -}} + {{- range .OutputFormats }} + {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{- end }} +{{- end -}} + +{{ if .IsHome -}} + {{ with .Site.GetPage (site.Params.homeCollection | default "") -}} + {{ template "outputFormats" . }} + {{ end }} +{{ else -}} + {{ template "outputFormats" . }} + {{ with .Parent -}} + {{ template "outputFormats" . }} + {{- end }} +{{- end }} {{- if .IsHome -}} <meta name="description" content="{{ site.Params.Description }}"/> |