Skip to content

Commit

Permalink
Refactor: Use hugo.IsMultilingual for consistency
Browse files Browse the repository at this point in the history
Replaced deprecated `.Site.IsMultiLingual` with `hugo.IsMultilingual` across multiple files to improve code consistency and compatibility. Also removed trailing spaces for better formatting.
  • Loading branch information
khalidabuhakmeh committed Jan 7, 2025
1 parent bfe0175 commit 0bd361d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<div class="highlightable">
<ul class="topics">

{{if eq .Site.Params.ordersectionsby "title"}}
{{if eq .Site.Params.ordersectionsby "title"}}
{{range .Site.Home.Sections.ByTitle}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{end}}
{{else}}
{{range .Site.Home.Sections.ByWeight}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{end}}
{{end}}
{{end}}
</ul>

{{ $disableShortcutsTitle := .Site.Params.DisableShortcutsTitle}}
Expand All @@ -31,19 +31,19 @@
<h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
<ul>
{{ range sort . "Weight"}}
<li>
<li>
{{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
</li>
{{end}}
</ul>
</section>
{{end}}

{{ if or .Site.IsMultiLingual $showvisitedlinks }}
{{ if or hugo.IsMultilingual $showvisitedlinks }}
<section id="prefooter">
<hr/>
<ul>
{{ if and .Site.IsMultiLingual (not .Site.Params.DisableLanguageSwitchingButton)}}
{{ if and hugo.IsMultilingual (not .Site.Params.DisableLanguageSwitchingButton)}}
<li>
<a class="padding">
<i class="fas fa-language fa-fw"></i>
Expand Down Expand Up @@ -77,7 +77,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
</a>
</li>
{{end}}

{{ if $showvisitedlinks}}
<li><a class="padding" href="#" data-clear-history-toggle=""><i class="fas fa-history fa-fw"></i> {{T "Clear-History"}}</a></li>
{{ end }}
Expand All @@ -99,7 +99,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{with .sect}}
{{if and .IsSection (or (not .Params.hidden) $.showhidden)}}
{{safeHTML .Params.head}}
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
{{if .IsAncestor $currentNode }}parent{{end}}
{{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}
{{if .Params.alwaysopen}}parent{{end}}
Expand All @@ -118,24 +118,24 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
{{end}}
{{ $pages := ($currentNode.Scratch.Get "pages") }}
{{if eq .Site.Params.ordersectionsby "title"}}

{{if eq .Site.Params.ordersectionsby "title"}}
{{ range $pages.ByTitle }}
{{ if and .Params.hidden (not $.showhidden) }}
{{ if and .Params.hidden (not $.showhidden) }}
{{else}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{end}}
{{ end }}
{{else}}
{{ range $pages.ByWeight }}
{{ if and .Params.hidden (not $.showhidden) }}
{{ if and .Params.hidden (not $.showhidden) }}
{{else}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{end}}
{{ end }}
{{end}}
</ul>
{{ end }}
{{ end }}
</li>
{{else}}
{{ if not .Params.Hidden }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script type="text/javascript" src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript" src="{{"js/auto-complete.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript">
{{ if .Site.IsMultiLingual }}
{{ if hugo.IsMultilingual }}
var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}";
{{ else }}
var baseurl = "{{.Site.BaseURL}}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<div class="highlightable">
<ul class="topics">

{{if eq .Site.Params.ordersectionsby "title"}}
{{if eq .Site.Params.ordersectionsby "title"}}
{{range .Site.Home.Sections.ByTitle}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{end}}
{{else}}
{{range .Site.Home.Sections.ByWeight}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks}}
{{end}}
{{end}}
{{end}}
</ul>

{{ $disableShortcutsTitle := .Site.Params.DisableShortcutsTitle}}
Expand All @@ -31,19 +31,19 @@
<h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
<ul>
{{ range sort . "Weight"}}
<li>
<li>
{{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
</li>
{{end}}
</ul>
</section>
{{end}}

{{ if or .Site.IsMultiLingual $showvisitedlinks }}
{{ if or hugo.IsMultilingual $showvisitedlinks }}
<section id="prefooter">
<hr/>
<ul>
{{ if and .Site.IsMultiLingual (not .Site.Params.DisableLanguageSwitchingButton)}}
{{ if and hugo.IsMultilingual (not .Site.Params.DisableLanguageSwitchingButton)}}
<li>
<a class="padding">
<i class="fas fa-language fa-fw"></i>
Expand Down Expand Up @@ -77,7 +77,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
</a>
</li>
{{end}}

{{ if $showvisitedlinks}}
<li><a class="padding" href="#" data-clear-history-toggle=""><i class="fas fa-history fa-fw"></i> {{T "Clear-History"}}</a></li>
{{ end }}
Expand All @@ -99,7 +99,7 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{with .sect}}
{{if and .IsSection (or (not .Params.hidden) $.showhidden)}}
{{safeHTML .Params.head}}
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
<li data-nav-id="{{.RelPermalink}}" title="{{.Title}}" class="dd-item
{{if .IsAncestor $currentNode }}parent{{end}}
{{if eq .File.UniqueID $currentFileUniqueID}}active{{end}}
{{if .Params.alwaysopen}}parent{{end}}
Expand All @@ -118,24 +118,24 @@ <h3>{{ if not $disableShortcutsTitle}}{{ T "Shortcuts-Title"}}{{ end }}</h3>
{{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
{{end}}
{{ $pages := ($currentNode.Scratch.Get "pages") }}
{{if eq .Site.Params.ordersectionsby "title"}}

{{if eq .Site.Params.ordersectionsby "title"}}
{{ range $pages.ByTitle }}
{{ if and .Params.hidden (not $.showhidden) }}
{{ if and .Params.hidden (not $.showhidden) }}
{{else}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{end}}
{{ end }}
{{else}}
{{ range $pages.ByWeight }}
{{ if and .Params.hidden (not $.showhidden) }}
{{ if and .Params.hidden (not $.showhidden) }}
{{else}}
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }}
{{end}}
{{ end }}
{{end}}
</ul>
{{ end }}
{{ end }}
</li>
{{else}}
{{ if not .Params.Hidden }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script type="text/javascript" src="{{"js/lunr.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript" src="{{"jquery-ui-1.13.2.custom/jquery-ui.min.js" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}"></script>
<script type="text/javascript">
{{ if .Site.IsMultiLingual }}
{{ if hugo.IsMultilingual }}
var baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}";
{{ else }}
var baseurl = "{{.Site.BaseURL}}";
Expand Down

0 comments on commit 0bd361d

Please sign in to comment.