Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mpourismaiel committed May 21, 2019
1 parent eb5adcb commit b380d81
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/fragments/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
{{- if eq .name "site" }}
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.Permalink }}"/>
{{- else if eq .name "page" }}
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.URL }}"/>
<input type="hidden" name="{{ .name }}" value="{{ $.root.Page.RelPermalink }}"/>
{{- else }}
<input type="hidden" name="{{ .name }}" value="{{ .value }}"/>
{{- end -}}
Expand Down
14 changes: 7 additions & 7 deletions layouts/partials/fragments/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@
class="row align-items-center justify-content-between mx-0 article-title">
{{- if $display_summary }}
<h4 class="col px-0 m-0
{{- if eq $.page.URL .URL }} active-page {{- end -}}
{{- if eq $.page.Permalink .Permalink }} active-page {{- end -}}
">
<a href="{{ .URL }}">
<a href="{{ .Permalink }}">
{{- .Params.title | markdownify -}}
</a>
</h4>
{{- else }}
<h5 class="col px-0 m-0
{{- if eq $.page.URL .URL }} active-page {{- end -}}
{{- if eq $.page.Permalink .Permalink }} active-page {{- end -}}
">
<a href="{{ .URL }}">
<a href="{{ .Permalink }}">
{{- .Params.title | markdownify -}}
</a>
</h5>
Expand Down Expand Up @@ -119,7 +119,7 @@
{{- end -}}
{{- end -}}
{{- if $self.Params.collapsible -}}
<div class="collapse {{- if eq $.page.URL .URL }} show {{- end }}">
<div class="collapse {{- if eq $.page.Permalink .Permalink }} show {{- end }}">
{{- end -}}
{{- range $content_page }}
{{- if and (ne $self.Params.images false) .Params.asset -}}
Expand Down Expand Up @@ -150,7 +150,7 @@
{{- else -}}
{{- printf " badge-%s" "secondary" -}}
{{- end -}}
" href="{{ .URL }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
" href="{{ .Permalink }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
{{- end -}}
{{- end -}}
{{- end -}}
Expand All @@ -165,7 +165,7 @@
{{- range $content_page }}
{{- if and (ne $self.Params.read_more false) (or $self.Params.read_more .Truncated) }}
<div class="card-footer">
<a href="{{ .URL }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
<a href="{{ .Permalink }}">{{ i18n "content.readmore" | default "Read more..." }}</a>
</div>
{{- end -}}
{{- end -}}
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/fragments/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<ul class="navbar-nav">
{{- if .Params.prepend -}}
{{- range sort .Params.prepend }}
{{- $isMenuCurrent := or (eq $.root.URL .url) (eq (printf "%s/" $.root.URL) .url) (eq $.root.URL (printf "%s/" .url)) -}}
{{- $isMenuCurrent := or (eq $.root.Permalink .url) (eq (printf "%s/" $.root.Permalink) .url) (eq $.root.Permalink (printf "%s/" .url)) -}}
<li class="nav-item">
<a href="{{ .url | relLangURL }}"
{{- if hasPrefix .URL "#" }}
Expand All @@ -54,7 +54,7 @@
{{- end }}
{{- if .Site.Menus.main -}}
{{- range sort .Site.Menus.main }}
{{- $isMenuCurrent := or (eq $.root.URL .URL) (eq (printf "%s/" $.root.URL) .URL) (eq $.root.URL (printf "%s/" .URL)) -}}
{{- $isMenuCurrent := or (eq $.root.Permalink .URL) (eq (printf "%s/" $.root.Permalink) .URL) (eq $.root.Permalink (printf "%s/" .URL)) -}}
<li class="nav-item">
<a href="{{ .URL | relLangURL }}"
{{- if hasPrefix .URL "#" }}
Expand All @@ -69,7 +69,7 @@
{{- end }}
{{- if .Params.postpend -}}
{{- range sort .Params.postpend }}
{{- $isMenuCurrent := or (eq $.root.URL .url) (eq (printf "%s/" $.root.URL) .url) (eq $.root.URL (printf "%s/" .url)) -}}
{{- $isMenuCurrent := or (eq $.root.Permalink .url) (eq (printf "%s/" $.root.Permalink) .url) (eq $.root.Permalink (printf "%s/" .url)) -}}
<li class="nav-item">
<a href="{{ .url | relLangURL }}"
{{- if hasPrefix .URL "#" }}
Expand Down Expand Up @@ -169,7 +169,7 @@
{{- print " aria-current=\"page\"" -}}
{{- end -}}>
{{- if ne $.root . }}
<a href="{{ .URL -}}">
<a href="{{ .Permalink -}}">
{{- .Title -}}
</a>
{{- else }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/fragments/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- if (isset . "data") -}}
{{- .page_scratch.Set "content_fragment_path" .data.content_fragment -}}
{{- .page_scratch.Set "content_page" .data.content_fragment -}}
{{- .page_scratch.Set "url" .data.page.URL -}}
{{- .page_scratch.Set "url" .data.page.Permalink -}}
{{- else -}}
{{- .page_scratch.Set "content_fragment_path" .Params.content -}}

Expand All @@ -32,7 +32,7 @@
{{- end -}}

{{- $page := cond (eq (.page_scratch.Get "page") "") $.page (.page_scratch.Get "page") -}}
{{- .page_scratch.Set "url" $page.URL -}}
{{- .page_scratch.Set "url" $page.Permalink -}}
{{- if (eq ($.page_scratch.Get "fragment_path") "index.md") -}}
{{- .page_scratch.Set "content_page" $page -}}
{{- else -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="description" content="{{- .Scratch.Get "page_description" -}}">
<meta property="og:title" content="{{ $title }}">
<meta property="og:url" content="{{ .URL | absURL }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:description" content="{{- .Scratch.Get "page_description" -}}">
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="{{ $title }}" />
<meta name="twitter:description" content="{{- .Scratch.Get "page_description" -}}">
<meta name="twitter:url" content="{{ .URL | absURL }}" />
<meta name="twitter:url" content="{{ .Permalink }}" />
{{- if $content_fragment -}}
{{- range $content_fragment -}}
{{- if and .Params.asset -}}
Expand Down
22 changes: 12 additions & 10 deletions layouts/partials/helpers/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,18 @@
{{- if $page_scratch.Get "fragments" -}}
{{- range ($page_scratch.Get "fragments") -}}
{{- $name := replace .Name "/index" "" -}}
{{- $directory_same_name := in ($page_scratch.Get "fragments_directory_name") (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
{{- if and (not .Params.disabled) (isset .Params "fragment") (not (where ($page_scratch.Get "page_fragments") ".Name" $name)) (not $directory_same_name) -}}
{{- if or $is_404 (ne .Params.fragment "404") -}}
{{- if eq .Params.fragment "config" -}}
{{- $page_scratch.Add "page_config" . -}}
{{- else -}}
{{- $page_scratch.Add "page_fragments" . -}}
{{- $page_scratch.Add "fragments_directory_name" (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
{{- if isset .Params "padding" -}}
{{- $page_scratch.Add "experimentals_used_messages" "FrontMatter variable 'padding' is experimental and may get removed without notice" -}}
{{- if $root.File -}}
{{- $directory_same_name := in ($page_scratch.Get "fragments_directory_name") (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
{{- if and (not .Params.disabled) (isset .Params "fragment") (not (where ($page_scratch.Get "page_fragments") ".Name" $name)) (not $directory_same_name) -}}
{{- if or $is_404 (ne .Params.fragment "404") -}}
{{- if eq .Params.fragment "config" -}}
{{- $page_scratch.Add "page_config" . -}}
{{- else -}}
{{- $page_scratch.Add "page_fragments" . -}}
{{- $page_scratch.Add "fragments_directory_name" (printf "%s%s/" $root.File.Dir (replace $name ".md" "")) -}}
{{- if isset .Params "padding" -}}
{{- $page_scratch.Add "experimentals_used_messages" "FrontMatter variable 'padding' is experimental and may get removed without notice" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
Expand Down

0 comments on commit b380d81

Please sign in to comment.