Skip to content

Commit

Permalink
Avoid warning 'calling IsSet with unsupported type "invalid" (<nil>)' (
Browse files Browse the repository at this point in the history
  • Loading branch information
deining committed Mar 8, 2023
1 parent 33e1a49 commit 01eafd3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
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

0 comments on commit 01eafd3

Please sign in to comment.