Using .GetPage in a menu loop

This is what I have. I’m trying to show each page’s long_title param in each menu item, but it’s showing up as empty " ".

<div class="carousel">
    {{ $Site := .Site }}
    {{ $currentPage := . }}
    {{ range $Site.Menus.main }}
    {{ $U := string (.URL | relLangURL) }}
    {{ $P := $Site.GetPage $U }}
    <div class="swiper-slide {{ if $currentPage.IsMenuCurrent "main" . }}current{{ end }}">
      <a href="{{ .URL | relLangURL }}">
        <h3>{{ .Name }}</h3>
        <blockquote>
          {{ $P.Param "long_title" }}
        </blockquote>
      </a>
    </div>
    {{ end }}
  </div>

I feel like I’m not dealing with .URL correctly.

To help you, please give us the menu-part from your config file. better the link to a GitHub repo.

No menu in my config. I have these in the .md files for my pages.

menu:
  main:
    weight: 20

The menu works. .Name and .URL works. It’s {{ $P.Param "long_title" }} that’s blank.

Seems like this could just be:

{{ .Page.Params.long_title }}

Might also want to think about .Permalink instead of .URL

I’m an idiot. I should have read the menu docs!