hextra icon indicating copy to clipboard operation
hextra copied to clipboard

Sidebar is present in HTML output for posts even if hidden

Open bloovis opened this issue 6 months ago • 3 comments

The generated HTML for blog posts contains a hidden sidebar that lists every post. This takes up a considerable amount of unnecessary space, reducing load time for blog posts. This is a problem for my blog, which has 283 posts.

As an example, here is the frontmatter for my original content/posts/_index.md:

title: "Posts"
cascade:
  type: blog

This caused one of my typical blog posts to generate an HTML file that contained 262713 bytes, with a hidden sidebar containing links to all 283 blog posts.

I added the following lines to the frontmatter for _index.md:

sidebar:
  exclude: true

That eliminated the sidebar from the generated HTML for the aforementioned post, and reduced its size to 43690 bytes.

I'm not sure if this a bug or a documentation issue.

bloovis avatar Jun 19 '25 18:06 bloovis

might be the mobile navigation that picks this up, will fix in the next release

imfing avatar Jun 23 '25 21:06 imfing

I was using Firefox on a Linux laptop, not a mobile device.

bloovis avatar Jun 24 '25 00:06 bloovis

I was using Firefox on a Linux laptop, not a mobile device.

Got it. My suspicion was that the mobile navigation (different than sidebar) got generated at build time, so even if you’re not on a mobile device, it could still affect the output depending on how the site was built

imfing avatar Jun 25 '25 07:06 imfing