From 5a8b531a7ce2f22eaa452ebab8325040982c9275 Mon Sep 17 00:00:00 2001
From: James Henstridge <james@jamesh.id.au>
Date: Wed, 07 Sep 2022 12:36:32 +0000
Subject: [PATCH] Improve links for sitemap and taxonomies (#569)

---
 layouts/partials/site-footer.html |    2 +-
 layouts/robots.txt                |   10 +++++-----
 layouts/_default/terms.html       |    8 ++++----
 layouts/partials/tags.html        |    6 +++---
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html
index de03410..093bb53 100644
--- a/layouts/_default/terms.html
+++ b/layouts/_default/terms.html
@@ -7,13 +7,13 @@
   </article>
   <div class="mw8 center">
     <section class="ph4">
-      {{ range $key, $value := .Data.Terms }}
+      {{ range $term := .Data.Pages }}
         <h2 class="f1">
-          <a href="{{ "/" | relLangURL }}{{ $.Data.Plural | urlize }}/{{ $key | urlize }}" class="link blue hover-black">
-            {{ $.Data.Singular | humanize }}: {{ $key }}
+          <a href="{{ $term.RelPermalink }}" class="link blue hover-black">
+            {{ $.Data.Singular | humanize }}: {{ $term.LinkTitle }}
           </a>
         </h2>
-        {{ range $value.Pages }}
+        {{ range $term.Pages }}
           {{ .Render "summary" }}
         {{ end }}
       {{ end }}
diff --git a/layouts/partials/site-footer.html b/layouts/partials/site-footer.html
index 41c0629..0fe6aa8 100755
--- a/layouts/partials/site-footer.html
+++ b/layouts/partials/site-footer.html
@@ -1,6 +1,6 @@
 <footer class="{{ .Site.Params.background_color_class | default "bg-black" }} bottom-0 w-100 pa3" role="contentinfo">
   <div class="flex justify-between">
-  <a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.BaseURL }}" >
+  <a class="f4 fw4 hover-white no-underline white-70 dn dib-ns pv2 ph3" href="{{ .Site.Home.Permalink }}" >
     &copy; {{ with .Site.Copyright | default .Site.Title }} {{ . | safeHTML }} {{ now.Format "2006"}} {{ end }}
   </a>
     <div>{{ partial "social-follow.html" . }}</div>
diff --git a/layouts/partials/tags.html b/layouts/partials/tags.html
index 976a9a2..fe1a94a 100644
--- a/layouts/partials/tags.html
+++ b/layouts/partials/tags.html
@@ -1,8 +1,8 @@
 <ul class="pa0">
-  {{ range .Params.tags }}
+  {{ range .GetTerms "tags" }}
    <li class="list di">
-     <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
-       {{- . -}}
+     <a href="{{ .RelPermalink }}" class="link f5 grow no-underline br-pill ba ph3 pv2 mb2 dib black sans-serif">
+       {{- .LinkTitle -}}
      </a>
    </li>
   {{ end }}
diff --git a/layouts/robots.txt b/layouts/robots.txt
index 7a24e82..d4efb29 100644
--- a/layouts/robots.txt
+++ b/layouts/robots.txt
@@ -1,8 +1,8 @@
 User-agent: *
-# robotstxt.org - if ENV production variable is false robots will be disallowed.
-{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")  }}
+{{/* robotstxt.org - if ENV production variable is false robots will be disallowed. */ -}}
+{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production")  -}}
 Allow: /
-Sitemap: {{.Site.BaseURL}}/sitemap.xml
-{{ else }}
+Sitemap: {{ "/sitemap.xml" | absURL }}
+{{ else -}}
 Disallow: /
-{{ end }}
+{{ end -}}

--
Gitblit v1.10.0