Skip to content

Commit 4b921a1

Browse files
authored
Merge pull request #568 from mpourismaiel/chore/global/v0.15-finalization
Fix deprecation warnings
2 parents 3843744 + b380d81 commit 4b921a1

File tree

6 files changed

+28
-26
lines changed

6 files changed

+28
-26
lines changed

layouts/partials/fragments/contact.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
{{- if eq .name "site" }}
137137
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.Permalink }}"/>
138138
{{- else if eq .name "page" }}
139-
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.URL }}"/>
139+
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.RelPermalink }}"/>
140140
{{- else }}
141141
<input type="hidden" name="{{ .name }}" value="{{ .value }}"/>
142142
{{- end -}}

layouts/partials/fragments/list.html

+7-7
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@
7878
class="row align-items-center justify-content-between mx-0 article-title">
7979
{{- if $display_summary }}
8080
<h4 class="col px-0 m-0
81-
{{- if eq $.page.URL .URL }} active-page {{- end -}}
81+
{{- if eq $.page.Permalink .Permalink }} active-page {{- end -}}
8282
">
83-
<a href="{{ .URL }}">
83+
<a href="{{ .Permalink }}">
8484
{{- .Params.title | markdownify -}}
8585
</a>
8686
</h4>
8787
{{- else }}
8888
<h5 class="col px-0 m-0
89-
{{- if eq $.page.URL .URL }} active-page {{- end -}}
89+
{{- if eq $.page.Permalink .Permalink }} active-page {{- end -}}
9090
">
91-
<a href="{{ .URL }}">
91+
<a href="{{ .Permalink }}">
9292
{{- .Params.title | markdownify -}}
9393
</a>
9494
</h5>
@@ -119,7 +119,7 @@
119119
{{- end -}}
120120
{{- end -}}
121121
{{- if $self.Params.collapsible -}}
122-
<div class="collapse {{- if eq $.page.URL .URL }} show {{- end }}">
122+
<div class="collapse {{- if eq $.page.Permalink .Permalink }} show {{- end }}">
123123
{{- end -}}
124124
{{- range $content_page }}
125125
{{- if and (ne $self.Params.images false) .Params.asset -}}
@@ -150,7 +150,7 @@
150150
{{- else -}}
151151
{{- printf " badge-%s" "secondary" -}}
152152
{{- end -}}
153-
" href="{{ .URL }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
153+
" href="{{ .Permalink }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
154154
{{- end -}}
155155
{{- end -}}
156156
{{- end -}}
@@ -165,7 +165,7 @@
165165
{{- range $content_page }}
166166
{{- if and (ne $self.Params.read_more false) (or $self.Params.read_more .Truncated) }}
167167
<div class="card-footer">
168-
<a href="{{ .URL }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
168+
<a href="{{ .Permalink }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
169169
</div>
170170
{{- end -}}
171171
{{- end -}}

layouts/partials/fragments/nav.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<ul class="navbar-nav">
4040
{{- if .Params.prepend -}}
4141
{{- range sort .Params.prepend }}
42-
{{- $isMenuCurrent := or (eq $.root.URL .url) (eq (printf "%s/" $.root.URL) .url) (eq $.root.URL (printf "%s/" .url)) -}}
42+
{{- $isMenuCurrent := or (eq $.root.Permalink .url) (eq (printf "%s/" $.root.Permalink) .url) (eq $.root.Permalink (printf "%s/" .url)) -}}
4343
<li class="nav-item">
4444
<a href="{{ .url | relLangURL }}"
4545
{{- if hasPrefix .URL "#" }}
@@ -54,7 +54,7 @@
5454
{{- end }}
5555
{{- if .Site.Menus.main -}}
5656
{{- range sort .Site.Menus.main }}
57-
{{- $isMenuCurrent := or (eq $.root.URL .URL) (eq (printf "%s/" $.root.URL) .URL) (eq $.root.URL (printf "%s/" .URL)) -}}
57+
{{- $isMenuCurrent := or (eq $.root.Permalink .URL) (eq (printf "%s/" $.root.Permalink) .URL) (eq $.root.Permalink (printf "%s/" .URL)) -}}
5858
<li class="nav-item">
5959
<a href="{{ .URL | relLangURL }}"
6060
{{- if hasPrefix .URL "#" }}
@@ -69,7 +69,7 @@
6969
{{- end }}
7070
{{- if .Params.postpend -}}
7171
{{- range sort .Params.postpend }}
72-
{{- $isMenuCurrent := or (eq $.root.URL .url) (eq (printf "%s/" $.root.URL) .url) (eq $.root.URL (printf "%s/" .url)) -}}
72+
{{- $isMenuCurrent := or (eq $.root.Permalink .url) (eq (printf "%s/" $.root.Permalink) .url) (eq $.root.Permalink (printf "%s/" .url)) -}}
7373
<li class="nav-item">
7474
<a href="{{ .url | relLangURL }}"
7575
{{- if hasPrefix .URL "#" }}
@@ -169,7 +169,7 @@
169169
{{- print " aria-current=\"page\"" -}}
170170
{{- end -}}>
171171
{{- if ne $.root . }}
172-
<a href="{{ .URL -}}">
172+
<a href="{{ .Permalink -}}">
173173
{{- .Title -}}
174174
</a>
175175
{{- else }}

layouts/partials/fragments/toc.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{{- if (isset . "data") -}}
66
{{- .page_scratch.Set "content_fragment_path" .data.content_fragment -}}
77
{{- .page_scratch.Set "content_page" .data.content_fragment -}}
8-
{{- .page_scratch.Set "url" .data.page.URL -}}
8+
{{- .page_scratch.Set "url" .data.page.Permalink -}}
99
{{- else -}}
1010
{{- .page_scratch.Set "content_fragment_path" .Params.content -}}
1111

@@ -32,7 +32,7 @@
3232
{{- end -}}
3333

3434
{{- $page := cond (eq (.page_scratch.Get "page") "") $.page (.page_scratch.Get "page") -}}
35-
{{- .page_scratch.Set "url" $page.URL -}}
35+
{{- .page_scratch.Set "url" $page.Permalink -}}
3636
{{- if (eq ($.page_scratch.Get "fragment_path") "index.md") -}}
3737
{{- .page_scratch.Set "content_page" $page -}}
3838
{{- else -}}

layouts/partials/head.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
<meta name="apple-mobile-web-app-status-bar-style" content="black">
2020
<meta name="description" content="{{- .Scratch.Get "page_description" -}}">
2121
<meta property="og:title" content="{{ $title }}">
22-
<meta property="og:url" content="{{ .URL | absURL }}">
22+
<meta property="og:url" content="{{ .Permalink }}">
2323
<meta property="og:description" content="{{- .Scratch.Get "page_description" -}}">
2424
<meta property="og:site_name" content="{{ .Site.Title }}">
2525
<meta property="og:type" content="website">
2626
<meta name="twitter:card" content="summary_large_image">
2727
<meta name="twitter:title" content="{{ $title }}" />
2828
<meta name="twitter:description" content="{{- .Scratch.Get "page_description" -}}">
29-
<meta name="twitter:url" content="{{ .URL | absURL }}" />
29+
<meta name="twitter:url" content="{{ .Permalink }}" />
3030
{{- if $content_fragment -}}
3131
{{- range $content_fragment -}}
3232
{{- if and .Params.asset -}}

layouts/partials/helpers/fragments.html

+12-10
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,18 @@
151151
{{- if $page_scratch.Get "fragments" -}}
152152
{{- range ($page_scratch.Get "fragments") -}}
153153
{{- $name := replace .Name "/index" "" -}}
154-
{{- $directory_same_name := in ($page_scratch.Get "fragments_directory_name") (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
155-
{{- if and (not .Params.disabled) (isset .Params "fragment") (not (where ($page_scratch.Get "page_fragments") ".Name" $name)) (not $directory_same_name) -}}
156-
{{- if or $is_404 (ne .Params.fragment "404") -}}
157-
{{- if eq .Params.fragment "config" -}}
158-
{{- $page_scratch.Add "page_config" . -}}
159-
{{- else -}}
160-
{{- $page_scratch.Add "page_fragments" . -}}
161-
{{- $page_scratch.Add "fragments_directory_name" (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
162-
{{- if isset .Params "padding" -}}
163-
{{- $page_scratch.Add "experimentals_used_messages" "FrontMatter variable 'padding' is experimental and may get removed without notice" -}}
154+
{{- if $root.File -}}
155+
{{- $directory_same_name := in ($page_scratch.Get "fragments_directory_name") (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
156+
{{- if and (not .Params.disabled) (isset .Params "fragment") (not (where ($page_scratch.Get "page_fragments") ".Name" $name)) (not $directory_same_name) -}}
157+
{{- if or $is_404 (ne .Params.fragment "404") -}}
158+
{{- if eq .Params.fragment "config" -}}
159+
{{- $page_scratch.Add "page_config" . -}}
160+
{{- else -}}
161+
{{- $page_scratch.Add "page_fragments" . -}}
162+
{{- $page_scratch.Add "fragments_directory_name" (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
163+
{{- if isset .Params "padding" -}}
164+
{{- $page_scratch.Add "experimentals_used_messages" "FrontMatter variable 'padding' is experimental and may get removed without notice" -}}
165+
{{- end -}}
164166
{{- end -}}
165167
{{- end -}}
166168
{{- end -}}

0 commit comments

Comments
 (0)