Commit 36999be3 authored by Matt Spencer's avatar Matt Spencer
Browse files

Merge branch 'community_menu' into 'main'

Add community menu item

See merge request !20
parents 579c4810 81104461
Pipeline #196 passed with stages
in 18 seconds
......@@ -42,3 +42,18 @@ googleAnalytics = "GTM-WLHTXFF"
pre = "blog"
pageref = "/blog"
weight = 2
[[menu.main]]
identifier = "community"
name = "Community"
weight = 3
[[menu.main]]
identifier = "gitlab"
parent = "community"
name = "Gitlab"
url = "https://gitlab.arm.com/soafee"
[[menu.main]]
identifier = "slack"
parent = "community"
name = "Slack"
url = "https://join.slack.com/t/soafee/shared_invite/zt-12e17668h-DttNpOtyFNi5H1udojYmtg"
......@@ -11,15 +11,29 @@
<ul class="navbar-nav">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
{{ $is := $currentPage.IsMenuCurrent "main" . }}
{{ $has := $currentPage.HasMenuCurrent "main" . }}
<li class="nav-item">
<a class="nav-link {{ if or ($is) ($has) }}active{{ end }}"
href="{{ .URL }}">
{{- $text := print .Name | safeHTML -}}
{{- $text -}}
{{ if .HasChildren }}
{{ $dropdownId := printf "navbarDD%s" .Identifier }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="{{$dropdownId}}" role="button" data-bs-toggle="dropdown" aria-expanded="false">
{{ .Name }}
</a>
</li>
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="{{$dropdownId}}">
{{ range .Children }}
{{ partial "menu_item"
(dict "ctx" . "currentPage" $currentPage "class" "dropdown-item")
}}
{{ end }}
</ul>
{{ else }}
{{ partial "menu_item"
(dict "ctx" . "currentPage" $currentPage "class" "nav-item")
}}
{{ end }}
{{ end }}
</ul>
</div>
......
{{ $currentPage := .currentPage | default . }}
{{ $ctx := .ctx | default . }}
{{ $is := $currentPage.IsMenuCurrent "main" $ctx }}
{{ $has := $currentPage.HasMenuCurrent "main" $ctx }}
<li>
<a class="{{.class}} nav-link {{ if or ($is) ($has) }}active{{ end }}"
href="{{ $ctx.URL }}">
{{- $text := print $ctx.Name | safeHTML -}}
{{- $text -}}
</a>
</li>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment