{{ $dashboards := .Site.Menus.dashboard_menu }} {{ $currentPage := path.Split (path.Clean .RelPermalink) }} {{ $displayed_in_homepage := .IsHome }} {{ $dashboards_to_show := slice }} {{/* Compile list of dashboards to show depending upon the page */}} {{ if or (eq $currentPage.File "dashboards") ($displayed_in_homepage) }} {{ $dashboards_to_show = $dashboards_to_show | append (where $dashboards "Identifier" "ne" "all_dashboards") }} {{ else if strings.HasSuffix $currentPage.Dir "/topics/" }} {{ range $dashboards }} {{if in (apply .Page.Params.dashboards_topics "urlize" ".") $currentPage.File }} {{ $dashboards_to_show = $dashboards_to_show | append . }} {{ end }} {{ end }} {{ end }}