OleVik / grav-theme-scholar

Scholar is an academic-focused theme, for publishing papers, articles, books, documentation, your blog, and even your resumé, with Grav.
https://olevik.net/staging/grav-skeleton-scholar
MIT License
15 stars 2 forks source link

Custom menu in site.yaml ignored #17

Closed zoof closed 3 years ago

zoof commented 4 years ago

I have a site where I've been using antimatter for years where I configured custom menu entries in site.yaml. I decided to try scholar and everything looks great but the menu entries are wrong. For example, with Antimatter, I get "Home", "Curriculum Vitae", "Publications", "Working papers" and "Contact" but upon activating scholar, there is no longer a "Home" entry and I get "Curriculum Vitae", "Contact" but the menu entries corresponding to the anchors are not present. Moreover, three additional pages that are "hidden" do show up. My menu configuration in site.yaml given is below.

menu:
  -
    text: Publications
    url: 'https://example.com/cv#publications'
  -
    text: 'Working papers'
    url: 'https://example.com/cv#working-papers'
  -
    text: Contact
    url: 'https://example.com/contact'
OleVik commented 4 years ago

Scholar's approach to menus is incompatible with Antimatter's. Specifically, it looks for immediate children of root and excludes Home (reference). It also does not take into account whether the Pages are visible or published, nor is a menu declared in site.yaml considered. A child-theme can, however, override scholar/partials/header.html.twig or just its links-block to override this behavior.

For the next minor-version I will adopt the for-loop to include only published and visible Pages.