all repos — website @ 2a226bc9543a032b03fd990dce05dbae5ec32415

My website

Simplify permalink handling
Alan Pearce alan@alanpearce.eu
Sat, 04 Apr 2020 22:52:48 +0200
commit

2a226bc9543a032b03fd990dce05dbae5ec32415

parent

8568ada6ddde91e4cd53ae2351385bca4d7d6531

2 files changed, 2 insertions(+), 2 deletions(-)

jump to
M layouts/index.htmllayouts/index.html
@@ -8,7 +8,7 @@ <h2>Latest Posts</h2>     <ul>
       {{- range first 3 .Site.RegularPages }}
       <li class="h-entry">
-        <a class="u-url p-name" href="{{ .RelPermalink | strings.TrimRight "/" }}">{{ .Title }}</a>
+        <a class="u-url p-name" href="{{ .RelPermalink }}">{{ .Title }}</a>
         <time class="dt-published" datetime="{{ .Date.Format "2006-01-02T15:04:05Z" }}">{{ .Date.Format "Monday, 2 January 2006" }}</time>
       </li>
       {{- end }}
M layouts/partials/hook_head_end.htmllayouts/partials/hook_head_end.html
@@ -1,2 +1,2 @@-<link href="{{ if .IsPage }}{{ .Permalink | replaceRE "/$" "" }}{{ else }}{{ .Permalink }}{{ end }}" rel="canonical">
+<link href="{{ if .IsPage }}{{ .Permalink | strings.TrimRight "/" }}{{ else }}{{ .Permalink }}{{ end }}" rel="canonical">
 <meta name="googlebot" content="noindex">