[br-gnome-org: 3/5] Fix Hugo .URL deprecation
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [br-gnome-org: 3/5] Fix Hugo .URL deprecation
- Date: Sun, 23 Jun 2019 01:54:19 +0000 (UTC)
commit 4b555e6b5ffd7a162590db34ad2436ac1b4a9dec
Author: Rafael Fontenelle <rafaelff gnome org>
Date: Fri Jun 21 13:27:21 2019 -0300
Fix Hugo .URL deprecation
Deprecated since Hugo version 0.55.0, showing the warning:
"Page’s .URL is deprecated and will be removed in a future
release. Use .Permalink or .RelPermalink. If what you want
is the front matter URL value, use .Params.url."
themes/gnomeish/layouts/_default/list.html | 4 ++--
themes/gnomeish/layouts/index.html | 4 ++--
themes/gnomeish/layouts/partials/head.html | 4 ++--
themes/gnomeish/layouts/partials/nav.html | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/themes/gnomeish/layouts/_default/list.html b/themes/gnomeish/layouts/_default/list.html
index 886bbb1..4b00d25 100644
--- a/themes/gnomeish/layouts/_default/list.html
+++ b/themes/gnomeish/layouts/_default/list.html
@@ -63,12 +63,12 @@
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
- <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n "newerPosts" }}</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n
"newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
- <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} →</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }}
→</a>
</li>
{{ end }}
</ul>
diff --git a/themes/gnomeish/layouts/index.html b/themes/gnomeish/layouts/index.html
index 525afc1..15c48e1 100644
--- a/themes/gnomeish/layouts/index.html
+++ b/themes/gnomeish/layouts/index.html
@@ -46,12 +46,12 @@
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
- <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n "newerPosts" }}</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n
"newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
- <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} →</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }}
→</a>
</li>
{{ end }}
</ul>
diff --git a/themes/gnomeish/layouts/partials/head.html b/themes/gnomeish/layouts/partials/head.html
index fcedafd..ecd4703 100644
--- a/themes/gnomeish/layouts/partials/head.html
+++ b/themes/gnomeish/layouts/partials/head.html
@@ -30,13 +30,13 @@
{{- with .Site.Params.fb_app_id }}
<meta property="fb:app_id" content="{{ . }}" />
{{- end }}
- <meta property="og:url" content="{{ .URL | absLangURL }}" />
+ <meta property="og:url" content="{{ .RelPermalink | absLangURL }}" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="{{ .Site.Title }}" />
<!-- Hugo Version number -->
{{ .Hugo.Generator -}}
<!-- Links and stylesheets -->
- <link rel="canonical" href="{{ .URL | absLangURL }}" />
+ <link rel="canonical" href="{{ .RelPermalink | absLangURL }}" />
<link rel="alternate" href="{{ "index.xml" | absLangURL }}" type="application/rss+xml" title="{{
.Site.Title }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css"
integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
/>
diff --git a/themes/gnomeish/layouts/partials/nav.html b/themes/gnomeish/layouts/partials/nav.html
index a61d365..5bb3d6a 100644
--- a/themes/gnomeish/layouts/partials/nav.html
+++ b/themes/gnomeish/layouts/partials/nav.html
@@ -20,13 +20,13 @@
<a class="navlinks-parent" href="javascript:void(0)">{{ .Name }}</a>
<div class="navlinks-children">
{{ range .Children }}
- <a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
+ <a href="{{ .RelPermalink | relLangURL }}">{{ .Name }}</a>
{{ end }}
</div>
</li>
{{ else }}
<li>
- <a title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
+ <a title="{{ .Name }}" href="{{ .RelPermalink | relLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
{{ end }}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]