[SOLVED] Check if current page is present in a menu

Don’t know if this is the best option, but gets the job done

{{ $current := print "/" (index (split .URL "/") 1) "/" }}
{{ $menu := .Site.Menus.company }}
{{ range $menu }}
   {{ if eq .URL $current }}
         <div class="bg-grey-lightest rounded-lg pt-8 pb-4 px-4 md:px-8 ">
              <h5 class="text-2xl medium mb-4 xl:mb-6">
                Menu Title
              </h5>
              {{- $firstUrlElement := print "/" (index (split .URL "/") 1) "/" -}}
              {{- range $menu -}}
                <a class="block leading-tight text-purple mb-4 xl:mb-4 hover:text-purple  {{if eq ($firstUrlElement|lower) (.URL|lower) }}active{{end}}" href="{{ .URL }}" title="{{ .Name }} page">
                  {{ .Name }}
                </a>
                {{ end }}
         </div>
   {{ end }}
{{ end }}