sgregoratto.me

Hugo files for www.sgregoratto.me
git clone git://git.sgregoratto.me/sgregoratto.me
Log | Files | Refs

commit 2dad159c3577d2a617c7ed093a8cc12cae4ea156
parent ca5ca798d304c7d9cb084bd6a8250ee93b7e436d
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date:   Sat, 26 Jan 2019 21:03:24 +1100

Add proper section detection for feeds

Diffstat:
Mlayouts/partials/footer.html | 2+-
Mlayouts/partials/header.html | 6+++++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -3,7 +3,7 @@ <nav> <a href="/blog/">Home</a> <a href="/">About</a> - <a href="/atom.xml">Feed</a> + <a href="/{{.Section}}/atom.xml">Feed</a> <!-- <a href="https://github.com/The-King-of-Toasters/">GitHub</a> --> <a href="/pubkey.txt">PGP</a> </nav> diff --git a/layouts/partials/header.html b/layouts/partials/header.html @@ -4,7 +4,11 @@ <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"/> <title>{{.Title}}</title> - <link rel="alternate" type="application/atom+xml" title="/var/log/trash Atom Feed" href="atom.xml"/> + {{ if .Section }} + {{ with .Site.GetPage "section" .Section }} + <link rel="alternate" type="application/atom+xml" title="{{ .Title }} Atom Feed" href="/{{.Section}}/atom.xml"/> + {{ end }} + {{ end }} <link rel="stylesheet" href="/css/style.css"/> </head> <body>