mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
14 hours ago a9294ae4c2e10b2c0d313dcfd6f0f3d520452f57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{{- /*
  Returns the aria-current value for a menu entry: "page" if it links to the
  current page, "true" if the current page is below it (Hugo's HasMenuCurrent,
  which includes pages inside the entry's section), or an empty string.
 
  @param page   page        The current page.
  @param entry  menu entry  The menu entry.
*/ -}}
{{- $current := "" -}}
{{- if .page.IsMenuCurrent "main" .entry -}}
  {{- $current = "page" -}}
{{- else if .page.HasMenuCurrent "main" .entry -}}
  {{- $current = "true" -}}
{{- end -}}
{{- return $current -}}