hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

Support navbar child items

Open guillaume-haerinck opened this issue 3 years ago • 5 comments

What does this PR change? What problem does it solve?

In the navbar, allow to display child items on mouse hover. Also works on mobile when you stay with your finger pressed for a bit.

For example with this setup in config.yml

menu:
  main:
    - identifier: blog
      name: Blog
      url: /
      weight: 1
    - name: Tags
      parent: blog
      url: /tags/
      weight: 1

# ...

We get the result below (live demonstration here)

image

Was the change discussed in an issue or in the Discussions before?

No

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here. -> Not relevant
  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it. -> Not relevant
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [ ] This change updates the overridden internal templates from HUGO's repository. -> Not relevant

guillaume-haerinck avatar Nov 06 '22 10:11 guillaume-haerinck

For me, this is adding an underscore under the navbar and putting the parent/child combo at the end of the navbar.

jbassetti avatar Nov 26 '22 00:11 jbassetti

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Nov 26 '22 10:11 sonarqubecloud[bot]

For me, this is adding an underscore under the navbar and putting the parent/child combo at the end of the navbar.

Well seen ! It worked well with multiple menu items but when there was only one the css for the carret down would go crazy, it is fixed now :)

guillaume-haerinck avatar Nov 26 '22 10:11 guillaume-haerinck

What does this PR change? What problem does it solve?

In the navbar, allow to display child items on mouse hover. Also works on mobile when you stay with your finger pressed for a bit.

For example with this setup in config.yml

menu:
  main:
    - identifier: blog
      name: Blog
      url: /
      weight: 1
    - name: Tags
      parent: blog
      url: /tags/
      weight: 1

# ...

We get the result below (live demonstration here)

image

Was the change discussed in an issue or in the Discussions before?

No

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here. -> Not relevant
  • [x] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it. -> Not relevant
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [ ] This change updates the overridden internal templates from HUGO's repository. -> Not relevant

That is a good alternative to this...

Screenshot from 2022-11-26 20-23-36

If we can't have what is shown in my screenshot above, then your pr is a really good alternative and should be merged asap.

seanmrnda avatar Nov 26 '22 12:11 seanmrnda

Sorry if I'm late to the party, is there any movement on the navbar sub menus? Would love to have the option and appreciate your work/effort!

ConorCorp avatar Jun 03 '24 19:06 ConorCorp