From 0fb4eafa637c073f8ab304bc5fb495c27521f672 Mon Sep 17 00:00:00 2001
From: Dave Rolsky <autarch@urth.org>
Date: Mon, 28 Sep 2020 16:43:06 +0000
Subject: [PATCH] Use relative URLs everywhere and remove <base> tag (#411)
---
exampleSite/config.toml | 1 -
layouts/_default/baseof.html | 13 +++++--------
layouts/partials/header.html | 2 +-
CONTRIBUTORS.md | 1 +
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index d524a51..ca02f49 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -76,3 +76,4 @@
- [Lorenzo Cameroni](https://github.com/came88)
- [Jared Sturdy](https://github.com/jsturdy)
- [Daniel Monteiro](https://github.com/dfamonteiro)
+- [Dave Rolsky](https://github.com/autarch)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index c95ec45..519bbc5 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -7,7 +7,6 @@
defaultcontentlanguage = "en"
paginate = 20
-canonifyurls = true
pygmentsstyle = "b2"
pygmentscodefences = true
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 0c381a4..66e101a 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -17,9 +17,6 @@
{{ template "_internal/twitter_cards.html" . }}
{{ template "_internal/opengraph.html" . }}
- {{ if .Permalink }}
- <base href="{{ .Permalink }}">
- {{ end }}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ if .Permalink }}
@@ -80,14 +77,14 @@
{{ end }}
{{ end }}
- <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | absURL }}" sizes="32x32">
- <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | absURL }}" sizes="16x16">
+ <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | relURL }}" sizes="32x32">
+ <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | relURL }}" sizes="16x16">
- <link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | absURL }}">
- <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | absURL }}">
+ <link rel="apple-touch-icon" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
+ <link rel="apple-touch-icon" sizes="180x180" href="{{ .Site.Params.touchicon | default "/images/apple-touch-icon.png" | relURL }}">
{{ range .AlternativeOutputFormats -}}
- {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
{{ end -}}
{{ hugo.Generator }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index f1b51a6..56e9e79 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -15,7 +15,7 @@
{{ with .Site.Menus.main}}
{{ range sort . }}
<li class="navigation-item">
- <a class="navigation-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
+ <a class="navigation-link" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
--
Gitblit v1.10.0