imfing / hextra

🔯 Modern, batteries-included Hugo theme for creating beautiful doc, blog and static websites
https://imfing.github.io/hextra/
MIT License
757 stars 177 forks source link

Sidebar menu is missing on screen > 768px #425

Closed William-LP closed 4 months ago

William-LP commented 4 months ago

Description

The left sidebar menu is missing on larger screen devices when having the following directory structure :

.
├── content
│   ├── _index.md
│   ├── something
│   │   ├── _index.md
│   │   ├── whatever.md
│   ├── foo.md
│   ├── bar.md

Note that I'm not using top level directory section like blog or docs.

Steps To Reproduce

  1. Create a new site
  2. Create the same directory structure as above
  3. Play with screen size to make the left sidebar appear and disappear

Expected Behavior

The left sidebar should be present on larger screen

Actual Behavior

There's no menu on larger screen, but the menu exist on smaller screen

Screenshots

screen-capture.webm

Environment

Additional Context

Let me know if you need more context or information

imfing commented 4 months ago

Can you try setting the type of the section to docs

https://imfing.github.io/hextra/docs/guide/organize-files/#layouts

880831ian commented 4 months ago

@imfing

Hi, I would like to ask by the way, I want to use blog type but want to enable sidebar, what should I do?

I need to create layouts/blog/single.html yourself and adjust {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} ?

I currently use docs with a sidebar, but I want to display the date and creation time like a blog. How should I do this?

William-LP commented 4 months ago

@imfing Thanks it works as expected !

imfing commented 4 months ago

@imfing

Hi, I would like to ask by the way, I want to use blog type but want to enable sidebar, what should I do?

I need to create layouts/blog/single.html yourself and adjust {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} ?

I currently use docs with a sidebar, but I want to display the date and creation time like a blog. How should I do this?

@880831ian hi this is not supported currently. you have to override the blog page template to include sidebar