{{- with .CurrentSection.RegularPages }}
  {{ $hasTocOrRelated := or  ($.Store.Get "hasToc") ($.Store.Get "hasRelated") }}
  <div
    class="overflow-y-auto {{ if $hasTocOrRelated }}
      max-h-96
    {{ else }}
      sticky top-[8rem] max-h-[70vh]
    {{ end }} relative mt-2 mb-8"
    data-turbo-preserve-scroll-container="in-this-section">
    <h2
      class="text-base font-semibold tracking-tight text-gray-600  dark:text-gray-400">
      In this section
    </h2>

    <ul id="in-sthis-section" class="mt-2">
      {{- range . }}
        <li>
          <a
            class="text-sm {{ if eq . $ }}
              font-bold text-blue-600 hover:text-blue-600
              dark:hover:text-blue-200 dark:text-blue-200 focus:font-bold
              scroll-active
            {{ else }}
              text-blue-600 hover:text-blue-500 dark:text-blue-500
              dark:hover:text-blue-400
            {{ end }}"
            href="{{ .RelPermalink }}"
            >{{ .LinkTitle }}</a
          >
        </li>
      {{- end }}
    </ul>
  </div>
{{- end }}
