{{ $show_translations := site.Params.hugoblox.footer.language_switcher | default true }}
{{ if .IsTranslated | and $show_translations }}
<div class="mx-auto flex gap-3 py-2 px-4">
  <div class="font-bold">
    {{- partial "functions/get_icon" (dict "name" "globe-alt" "attributes" `class="inline-block pr-1" style="height: 1em"`) -}}
    {{ i18n "languages" }}:
  </div>
  <div class="font-bold">{{ index hugo.Data.languages .Lang }}</div>
  {{ range .Translations }}
  <div><a href="{{ .Permalink }}">{{ index hugo.Data.languages .Lang }}</a></div>
  {{ end }}
</div>
{{ end }}

{{/* Footer nav links - single level */}}
{{ $menu := .Site.Menus.footer }}
{{ with $menu }}
<nav class="flex flex-wrap justify-center gap-x-8 gap-y-2 py-4">
  {{ range $index, $menuItem := . }}
  <a href="{{ $menuItem.URL | relLangURL }}"
     class="text-base font-medium text-gray-500 hover:text-primary-600 dark:text-gray-300 dark:hover:text-primary-300"
     {{ if findRE `^http` $menuItem.URL }}
     target="_blank" rel="noopener"
     {{ end }}
  >
    {{ $menuItem.Name }}
  </a>
  {{ end }}
</nav>
{{ end }}

{{/* Social links */}}
{{- $show_social := site.Params.hugoblox.footer.show_social | default true -}}
{{ if $show_social }}
{{ with site.Params.hugoblox.identity.social.links }}
<div class="flex justify-center py-4 text-xl">
  {{ partial "social_links" (dict "Params" (dict "profiles" .)) }}
</div>
{{ end }}
{{ end }}

{{ with site.Params.hugoblox.footer.text }}
<p class="text-center">
  {{ . | markdownify | emojify }}
</p>
{{ end }}

{{/* Display copyright license. */}}
{{ partial "site_footer_license" . }}
