Large docs-only site: page file size becoming an issue #975
Replies: 4 comments 5 replies
-
Hi. I'm not a Docsy expert. Just wondering if you've looked at the config for the Kubernetes docs site? It has a lot of pages and is very responsive. https://github.com/kubernetes/website/blob/main/config.toml |
Beta Was this translation helpful? Give feedback.
-
Yes, we looked at the Kubernetes docs, as they are one of the more prominent examples of Docsy. In their HTML output for an average page like this one the section menu takes up about 1500 lines of HTML code in a 2100-line file. So, it ends up being significant portion of the file size for each of their content pages. It's probably not enough to drag the browser down in their case, though. When you load one of our pages, the nav section freezes for a while, I assume because it takes the browser a while to crunch through a multi-level UL list that has 5000 entries. |
Beta Was this translation helpful? Give feedback.
-
Hi @gary-vertica, everything I write is untested and pure speculation, but I'd try to:
Step 2 is easy to test, and if that or something similar works, then the trick is to get Step 1 working. You could try to solve that problem either in Hugo, or using a postprocessing script.
|
Beta Was this translation helpful? Give feedback.
-
Actually, after a quick test it seems to work, the only problem is that if the sidebar is set to be foldable (sidebar_menu_foldable = true Here is what I did:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
We're working on converting our 5000+ page documentation site over to Hugo+Docsy. After the conversion, I'm finding the site is not terribly responsive. It turns out that every content file is at least 1.6MB, mainly due to the entire section menu (containing all 5000 pages) repeats in every file. The total size for the converted site on disk is over 7GB. That's pretty untenable. After every page navigation, there is a pause as the browser spends time parsing/rendering the section menu.
Is there a way to get Docsy or Hugo to render just the part of the section menu that is visible when the sidebar_menu_compact parameter is set to true? There's no reason to have the rest of the hidden entries in the file.
I saw the mention of the sidebar_cache_limit setting in the documentation, but it sounds like this option only applies to how Hugo builds the site, not its output. Correct? Changing it to a lower value seems to have no effect on the file sizes.
Beta Was this translation helpful? Give feedback.
All reactions