lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
205 stars 97 forks source link

HasChildren = false doesn't seem to work #59

Closed tgamblin closed 1 year ago

tgamblin commented 1 year ago

I've got this in config.toml:

    menu = [
        # ... /content/about/about.md
        {Name = "About", URL = "/about/", HasChildren = false},

        # ... /content/publications/publications.md
        {Name = "Publications", URL = "/publications/", HasChildren = false},

        # ... /content/posts/introducing-poison.md
        {Name = "Posts", URL = "/posts/", HasChildren = true, Limit = 20},
    ]

The about page shows up ok:

Screenshot 2023-03-11 at 6 43 11 PM

But publications seems to think it should be a list:

Screenshot 2023-03-11 at 6 42 33 PM

Is this expected?

lukeorth commented 1 year ago

Hi @tgamblin - thank you for the question. You should be able to resolve this issue by making the following two edits:

  1. Change .../content/publications/publications.md to .../content/publications/_index.md
  2. Add layout: single to the front matter

image

image

The reason my About page doesn't do this is because I've setup a custom layout in the theme to automatically handle this type of content. You could do something similar for your Publications if you want by following these instructions, but I find the steps above to be a bit simpler.

Let me know if this fixes things for you!

tgamblin commented 1 year ago

ok that works -- I guess it's weird that about is different from other pages but I see that I just missed this in the documentation. Thanks.