Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid warning 'calling IsSet with unsupported type "invalid" (<nil>)' #1465

Merged
merged 3 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions layouts/partials/sidebar-tree.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{/* We cache this partial for bigger sites and set the active class client side. */}}
{{ $sidebarCacheLimit := cond (isset .Site.Params.ui "sidebar_cache_limit") .Site.Params.ui.sidebar_cache_limit 2000 -}}
{{/* We cache this partial for bigger sites and set the active class client side. */ -}}
{{ $sidebarCacheLimit := .Site.Params.ui.sidebar_cache_limit | default 2000 -}}
{{ $shouldDelayActive := ge (len .Site.Pages) $sidebarCacheLimit -}}
<div id="td-sidebar-menu" class="td-sidebar__inner{{ if $shouldDelayActive }} d-none{{ end }}">
{{ if not .Site.Params.ui.sidebar_search_disable -}}
Expand All @@ -26,8 +26,8 @@
{{ end -}}
{{ $navRoot := cond (and (ne .Params.toc_root true) (eq .Site.Home.Type "docs")) .Site.Home .FirstSection -}}
{{ $ulNr := 0 -}}
{{ $ulShow := cond (isset .Site.Params.ui "ul_show") .Site.Params.ui.ul_show 1 -}}
{{ $sidebarMenuTruncate := cond (isset .Site.Params.ui "sidebar_menu_truncate") .Site.Params.ui.sidebar_menu_truncate 50 -}}
{{ $ulShow := .Site.Params.ui.ul_show | default 1 -}}
{{ $sidebarMenuTruncate := .Site.Params.ui.sidebar_menu_truncate | default 50 -}}
<ul class="td-sidebar-nav__section pe-md-3 ul-{{ $ulNr }}">
{{ template "section-tree-nav-section" (dict "page" . "section" $navRoot "shouldDelayActive" $shouldDelayActive "sidebarMenuTruncate" $sidebarMenuTruncate "ulNr" $ulNr "ulShow" (add $ulShow 1)) }}
</ul>
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/* The "active" toggle here may delay rendering, so we only cache this side bar menu for bigger sites.
*/}}{{ $sidebarCacheLimit := cond (isset .Site.Params.ui "sidebar_cache_limit") .Site.Params.ui.sidebar_cache_limit 2000 -}}
{{/* The "active" toggle here may delay rendering, so we only cache this side bar menu for bigger sites. */ -}}
{{ $sidebarCacheLimit := .Site.Params.ui.sidebar_cache_limit | default 2000 -}}
{{ $shouldCache := ge (len .Site.Pages) $sidebarCacheLimit -}}
{{ $sidebarCacheTypeRoot := cond (isset .Site.Params.ui "sidebar_cache_type_root") .Site.Params.ui.sidebar_cache_type_root false -}}
{{ $sidebarCacheTypeRoot := .Site.Params.ui.sidebar_cache_type_root | default false -}}
{{ if $shouldCache -}}
{{ $mid := printf "m-%s" (.RelPermalink | anchorize) }}
<script>
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/taxonomy_terms_article_wrapper.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $context := . }}
{{ if isset .Site.Params "taxonomy" }}
{{ if isset .Site.Params.Taxonomy "taxonomypageheader" }}
{{ if .Site.Params.Taxonomy }}
{{ if .Site.Params.Taxonomy.taxonomyPageHeader }}
{{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyPageHeader }}
{{ partial "taxonomy_terms_article.html" (dict "context" $context "taxo" $taxo) }}
{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions layouts/partials/taxonomy_terms_clouds.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ $context := . }}
{{ if isset .Site.Params "taxonomy" }}
{{ if isset .Site.Params.Taxonomy "taxonomycloud" }}
{{ if .Site.Params.taxonomy }}
{{ if .Site.Params.Taxonomy.taxonomyCloud }}
{{ range $index, $taxo := .Site.Params.Taxonomy.taxonomyCloud }}
{{ if isset $.Site.Params.Taxonomy "taxonomycloudtitle" }}
{{ if $.Site.Params.Taxonomy.taxonomyCloudTitle }}
{{ $.Scratch.Set "title" (index $.Site.Params.Taxonomy.taxonomyCloudTitle $index) }}
{{ else }}
{{ $.Scratch.Set "title" (humanize $taxo) }}
Expand Down