Replace uses of the deprecated .URL field with .Permalink. (#2530)

This commit is contained in:
Martin Taillefer 2018-09-05 16:14:12 -07:00 committed by GitHub
parent fb54fb0268
commit 7e6a8924bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 14 deletions

View File

@ -16,7 +16,7 @@
<div class="card-body"> <div class="card-body">
{{ $questions := .Resources.ByType "page" }} {{ $questions := .Resources.ByType "page" }}
{{ $sorted_questions := sort $questions ".Params.weight" }} {{ $sorted_questions := sort $questions ".Params.weight" }}
{{ $url := .URL }} {{ $url := .Permalink }}
{{ range $q := $sorted_questions }} {{ range $q := $sorted_questions }}
<a href="{{ $url }}#{{ $q.File.BaseFileName | urlize }}">{{ $q.Title }}</a><br/> <a href="{{ $url }}#{{ $q.File.BaseFileName | urlize }}">{{ $q.Title }}</a><br/>
{{ end }} {{ end }}

View File

@ -16,7 +16,7 @@
<div class="card-body"> <div class="card-body">
{{ $questions := .Resources.ByType "page" }} {{ $questions := .Resources.ByType "page" }}
{{ $sorted_questions := sort $questions ".Params.weight" }} {{ $sorted_questions := sort $questions ".Params.weight" }}
{{ $url := .URL }} {{ $url := .Permalink }}
{{ range $q := $sorted_questions }} {{ range $q := $sorted_questions }}
<a href="{{ $url }}#{{ $q.File.BaseFileName | urlize }}">{{ $q.Title }}</a><br/> <a href="{{ $url }}#{{ $q.File.BaseFileName | urlize }}">{{ $q.Title }}</a><br/>
{{ end }} {{ end }}

View File

@ -5,7 +5,7 @@
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark justify-content-between"> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark justify-content-between">
{{ $home := .Site.GetPage "home" }} {{ $home := .Site.GetPage "home" }}
<a class="navbar-brand" href="{{ $home.URL }}"> <a class="navbar-brand" href="{{ $home.Permalink }}">
<span class="logo">{{ partial "icons/istio-logo-blue-background-round.svg" }}</span> <span class="logo">{{ partial "icons/istio-logo-blue-background-round.svg" }}</span>
{{ if .Site.Data.args.archive }} {{ if .Site.Data.args.archive }}
@ -26,23 +26,23 @@
<ul id="navbar-links" class="navbar-nav active"> <ul id="navbar-links" class="navbar-nav active">
{{ with (.Site.GetPage "section" "docs") }} {{ with (.Site.GetPage "section" "docs") }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{ if eq $section "docs" }}active{{ end }}" title="{{ .Description }}" href="{{ .URL }}">{{ .LinkTitle }}</a> <a class="nav-link {{ if eq $section "docs" }}active{{ end }}" title="{{ .Description }}" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li> </li>
{{ end }} {{ end }}
{{ with $latest_post }} {{ with $latest_post }}
<li class="nav-item"> <li class="nav-item">
{{ $blog_home := .Site.GetPage "section" "blog" }} {{ $blog_home := .Site.GetPage "section" "blog" }}
<a class="nav-link {{ if eq $section "blog" }}active{{ end }}" title="{{ $blog_home.Description }}" href="{{ .URL }}">{{ $blog_home.LinkTitle }}</a> <a class="nav-link {{ if eq $section "blog" }}active{{ end }}" title="{{ $blog_home.Description }}" href="{{ .Permalink }}">{{ $blog_home.LinkTitle }}</a>
</li> </li>
{{ end }} {{ end }}
{{ with (.Site.GetPage "section" "help") }} {{ with (.Site.GetPage "section" "help") }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{ if eq $section "help" }}active{{ end }}" title="{{ .Description }}" href="{{ .URL }}">{{ .LinkTitle }}</a> <a class="nav-link {{ if eq $section "help" }}active{{ end }}" title="{{ .Description }}" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li> </li>
{{ end }} {{ end }}
{{ with (.Site.GetPage "section" "about") }} {{ with (.Site.GetPage "section" "about") }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link {{ if eq $section "about" }}active{{ end }}" title="{{ .Description }}" href="{{ .URL }}">{{ .LinkTitle }}</a> <a class="nav-link {{ if eq $section "about" }}active{{ end }}" title="{{ .Description }}" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li> </li>
{{ end }} {{ end }}

View File

@ -29,14 +29,14 @@
<div class="row"> <div class="row">
<div class="col-6 pagenav"> <div class="col-6 pagenav">
{{ if .NextInSection }} {{ if .NextInSection }}
<p><a title="{{ .NextInSection.Description }}" href="{{ .NextInSection.URL }}"> <p><a title="{{ .NextInSection.Description }}" href="{{ .NextInSection.Permalink }}">
<i class="fa fa-long-arrow-alt-left"></i> {{ .NextInSection.LinkTitle }}</a> <i class="fa fa-long-arrow-alt-left"></i> {{ .NextInSection.LinkTitle }}</a>
</p> </p>
{{ end }} {{ end }}
</div> </div>
<div class="col-6 pagenav" style="text-align: right"> <div class="col-6 pagenav" style="text-align: right">
{{ if .PrevInSection }} {{ if .PrevInSection }}
<p><a title="{{ .PrevInSection.Description }}" href="{{ .PrevInSection.URL }}">{{ .PrevInSection.LinkTitle }} <p><a title="{{ .PrevInSection.Description }}" href="{{ .PrevInSection.Permalink }}">{{ .PrevInSection.LinkTitle }}
<i class="fa fa-long-arrow-alt-right"></i></a> <i class="fa fa-long-arrow-alt-right"></i></a>
</p> </p>
{{ end }} {{ end }}

View File

@ -30,7 +30,7 @@
<main aria-labelledby="title"> <main aria-labelledby="title">
{{ if not .Parent.IsHome }} {{ if not .Parent.IsHome }}
<div class="pagenav"> <div class="pagenav">
<p><a href="{{.Parent.URL}}" title="{{ .Parent.Description }}"> <p><a href="{{ .Parent.Permalink }}" title="{{ .Parent.Description }}">
<i style="transform: scaleX(-1)" class="fa fa-level-up-alt"></i> <i style="transform: scaleX(-1)" class="fa fa-level-up-alt"></i>
&nbsp;{{.Parent.Title}}</a></p> &nbsp;{{.Parent.Title}}</a></p>
</div> </div>

View File

@ -16,17 +16,17 @@
{{ else }} {{ else }}
<i class='fa fa-lg fa-caret-down'></i> <i class='fa fa-lg fa-caret-down'></i>
{{ end }} {{ end }}
<a {{ if eq $current.URL .URL }}class="current"{{ end }} title="{{ .Description }}" href="{{ .URL }}">{{ .LinkTitle}} </a> <a {{ if eq $current.Permalink .Permalink }}class="current"{{ end }} title="{{ .Description }}" href="{{ .Permalink }}">{{ .LinkTitle}} </a>
</label> </label>
{{ partial "sidebar-level.html" (dict "pages" $pages "parent" . "current" $current "collapse" $collapse) }} {{ partial "sidebar-level.html" (dict "pages" $pages "parent" . "current" $current "collapse" $collapse) }}
</li> </li>
{{ else }} {{ else }}
<li> <li>
{{ if eq $current.URL .URL }} {{ if eq $current.Permalink .Permalink }}
<span class="current" title="{{ .Description }}">{{ .LinkTitle }}</span> <span class="current" title="{{ .Description }}">{{ .LinkTitle }}</span>
{{ else }} {{ else }}
<a title="{{ .Description }}" href="{{ .URL }}">{{ .LinkTitle }}</a> <a title="{{ .Description }}" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
{{ end }} {{ end }}
</li> </li>
{{ end }} {{ end }}

View File

@ -15,7 +15,7 @@
{{ if eq .Parent $parent }} {{ if eq .Parent $parent }}
<div class="col-xs-12 col-sm-6 col-xl-4 entry"> <div class="col-xs-12 col-sm-6 col-xl-4 entry">
<h5> <h5>
<a href="{{ .URL }}"> <a href="{{ .Permalink }}">
{{ if .Params.icon }} {{ if .Params.icon }}
<img src="{{ .Params.icon }}" alt="Icon" class="page_icon" /> <img src="{{ .Params.icon }}" alt="Icon" class="page_icon" />
{{ end }} {{ end }}