Comments (10)
I haven't run test, but I think even with thousand of pages in side menu browser should not struggle to render. Regardless of that 1k pages in sidemenu probably will result in bad UX.
I think to add variable like bookMenuHide: true
to hide page from side menu even tho it's rendered by hugo 🤔
from hugo-book.
Here we go
# (Optional) Set true to hide page or section from side menu (if BookMenuBundle not set)
bookHidden: true
from hugo-book.
Hi!
I pushed an update, please check if it is what you are looking for.
New logic is:
- If there is "*" all sections rendered first level
- If one specific section is set - then menu rendered starting from first level children
from hugo-book.
Thank Alex, looks great but I am worried about showing all the posts in the menu which ultimately will lead to clutter.
Would it be possible to simply have the Posts folder and have them as a blog in there? with pagination?
Sorry if I am asking something crazy.
thanks
from hugo-book.
I think in your case it's hard to add it in generic way into theme,
I would suggest you to override layouts/partials/docs/inject/menu-after.html
and add something like
<ul>
<li>
<a href="{{ relref . "/posts" }}">Blog</a>
</li>
</ul>
This will effectively add Blog
link into menu.
from hugo-book.
Nice one! thanks so much Alex... I will give it a spin.
from hugo-book.
Interesting approach with the posts folder. Will jump in on this thread with a couple of related questions if that’s OK:
-
Is this approach possible for docs subfolders too i.e. can we render their single pages as a paginated list too while keeping only subfolders on the menu? (Right now navigating to /docs/ shows an empty page while /docs/subfolder/ throws a 404.)
-
If we have several hundred single pages under about ten or twelve docs subfolders, does it take a toll on page load. (The importance of 1 gets bumped up if there is a hit on page load with the current set-up.)
from hugo-book.
-
I think it will be too much opinionated/hardcoded to have paginated list in
/docs
but you can control content of/docs
withcontent/docs/_index.md
file. You can check that inexampleSite
-
Menu is generated statically and it's a text, so I believe there will no be performance hit, unless we talking about tens of thousands of pages. I would suggest to use bundle menu for such big sites.
from hugo-book.
-
Perhaps you're right. I took a look inside
exampleSite
and I think I follow. Thanks. -
I understand you mean that a bundle menu, i.e. the one displayed based on manual curation in
menu/index.md
, will not take a performance hit despite a few thousand pages. Is that correct? It does make sense since, for the reader, all that’s being done is a bunch of html being rendered on screen.
from hugo-book.
Haha. True. But I've made the menu collapsible so it should help from a design perspective.
I think such a front matter option would a good idea. It's not overbearing and it provides useful added functionality.
from hugo-book.
Related Issues (20)
- Text layout shift on page load HOT 1
- Adding a shortcode rawhtml HOT 2
- How to set the entry first page ? HOT 1
- How to: to place taxonomies on the side bar
- Question about using nested file tree HOT 1
- No easy way to display homepage in sidebar menu with activation state HOT 2
- Is there a way to prevent tables from wrapping? HOT 2
- Remove section description HOT 2
- Having the search returning text fragments URL when it matches the page content HOT 1
- Multiple Books On One Site HOT 4
- Clicking one of the search result resets the result list HOT 1
- Hope to add `pagefind` as the default search engine for the theme to increase search speed HOT 3
- Documentation to Change Syntax Highlighting Colorscheme HOT 1
- Asciidoc code blocks not highlighted HOT 1
- shortcode for details is not great
- How to wrap long lines inside of markdown ``` code ``` in hugo-book? HOT 1
- Header image HOT 1
- Disqus not working HOT 1
- How to add a theme switching button? HOT 2
- Translating Language Names HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-book.