Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sidebar menu quirks #79

Closed
jcw opened this issue Oct 6, 2017 · 9 comments
Closed

Sidebar menu quirks #79

jcw opened this issue Oct 6, 2017 · 9 comments
Labels

Comments

@jcw
Copy link

jcw commented Oct 6, 2017

I'm having oodles of fun building a new documentation website with this theme (and Hugo 0.29), but there seem to be some inconsistencies in the sidebar and {{% children ... %}} shortcode. Easiest is probably just for anyone reading this to visit the https://docs.jeelabs.org site: if you keep on pressing the right arrow, funny things happen in the last few menu entries. Also, on the home page, the description of the last child entry is missing. These strange effects tend to change as I edit, it's a bit of a Heisenberg Effect, it seems...

I'm not sure if this is a Learn-theme or a Hugo issue, but it would be helpful to know if others have been running into similar cases.

The other weird effect is that the home page gets completely messed up in live mode when I change any of the pages on the site. Everything looks normal again after restarting Hugo.

Finding all the children in nested directories, some with _index.md files, others with other names, is probably quite tricky. But maybe it's all due to some mistake on my part? I can't figure it out so far...

@jcw
Copy link
Author

jcw commented Oct 6, 2017

Update: without the nested menu's, I no longer see the sidebar issues described earlier. There's definitely something fishy going on, but it may be hard pinpoint after all.

@siddhantrimal
Copy link

siddhantrimal commented Oct 24, 2017

Hey, great issue. Good to know before I move much further with this theme, as great as it is!

You also have this issue

ps. Also, I'd like your permission to copy your walkthrough on that page. My collaborators are finding it hard to follow my instructions 😅

@jcw
Copy link
Author

jcw commented Oct 24, 2017

Heh, sure - copy away :)

@jcw
Copy link
Author

jcw commented Nov 1, 2017

I'm still seeing this issue - at the moment, my site shows a "Projects" menu item, but its description on the home page is missing. It's a bit hit-and-miss - on each edit and rebuild, the problem moves around, causing one or more descriptions to vanish, even if only unrelated pages have changed. The source code for this site is here, each commit triggers a web-hook and auto-generates the static site. This issue is still present in Hugo v0.30.2 (64-bit Linux build from Hugo's Releases page).

@matcornic
Copy link
Owner

Thanks @jcw for reporting this issue , I indeed faced this kind of issue once, but a rebuild and it was OK.

I see the issue is still present for the page https://docs.jeelabs.org/projects/mps/ . I checked in the HTML of the page: menu entries are not present for this page only. It seems to happen while building the application.

Do you use hugo server or do you hugo build your site and hosting it in another webserver ?

@matcornic matcornic added the bug label Nov 16, 2017
@jcw
Copy link
Author

jcw commented Nov 18, 2017

During edits, I use “hugo server”. The final result is produced with a daily “hugo” crontab job on the same machine as the webserver (I use “caddy” as webserver).

@JasonTheAdams
Copy link

JasonTheAdams commented Dec 11, 2017

I believe this is related. We're using the {{% children %}} shortcode on this page and for some reason the children aren't showing up in the menu: https://piklist.github.io/Piklist-Documentation/tutorials/fields/

The children were files instead of sub-directories, and I thought that was perhaps the issue, but changing them one way or the other doesn't seem to make a difference. This page shows 2-levels of pages just fine, and I can't find any difference. Hmm.

The issue happens both locally and after compiling.

@gpospelov
Copy link
Contributor

gpospelov commented Jan 9, 2018

I also see the same issue (Hugo 0.32.3, Linux-64bit). To reproduce

  • Clone your theme locally, generate site content in public dir
    cd exampleSite; hugo
  • Save the content somewhere, generate the content once again
    mv public public2; hugo
  • Compare two directories
    diff -r public/ public2/
  • Comparison will show the difference in menu structure of one of index.html, for example
diff -r public/en/credits/index.html public2/en/credits/index.html
>     <li data-nav-id="/en/basics/requirements/" title="Requirements" class="dd-item ">
>       <a href="/en/basics/requirements/">
>           Requirements
>             <i class="fa fa-check read-icon"></i>
>       </a>
>     </li>
  • Meaning that part of menu will be present in one case and absent in another.
  • This is completely random and next attempt can give different results.
  • It looks like it has nothing to do with collapse/expand part of menu machinery, just recursion in template of menu.html sometime stops working and part of code related to menu tree is not generated.
  • I tried to strip theme completely from breadcrumb, children shortcode etc and it still shows same behavior

I'm working on theme based on yours with simplified version of your menu.html (no showVisited etc) and it demonstrates same random behavior.
Repository, Page with working menu, Page with broken menu

I'm not a Hugo expert, any hint here will be really helpful.

@matcornic
Copy link
Owner

@JasonTheAdams @jcw @siddhantrimal Could you test again with latest commit of the theme ? I just merged an attempt of fix by @gpospelov :)

Thanks for the feedback.

@matalo33 matalo33 closed this as completed Nov 2, 2018
patrick-othmer pushed a commit to patrick-othmer/hugo-theme-learn that referenced this issue Oct 7, 2021
patrick-othmer pushed a commit to patrick-othmer/hugo-theme-learn that referenced this issue Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants