website icon indicating copy to clipboard operation
website copied to clipboard

✨ Enhancement: Special sidebar behaviour for pages for pages without sidebar item

Open benjagm opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe

We have some pages without sidebar item that needs to be shown, however when we show those pages it results in a sidebar with all sections collapsed. For example, the page https://json-schema.org/md-style-guide produces:

Screenshot 2024-10-09 at 06 37 23

This is not ideal and we would like to find a better way to interact with the sidebar for those pages.

Describe the solution you'd like

Ideally, we'd like to define a new property in the header metadata in the page markdown to specify the parent page to be highlighted in the sidebar.

For example, if we define this new property as parentNav adding the relative path for a page without sidebar item like https://json-schema.org/md-style-guide:

---
title: Markdown Style Guide
parentNav: /overview/what-is-jsonschema
---

The expected result is to highlight /overview/what-is-jsonschema in the sidebar when accessing that page. See image below: Screenshot 2024-10-09 at 06 42 25

Describe alternatives you've considered

I think this will require:

  • Define the new property in the markdown metadata.
  • Define a mechanism to read that property in the typescript code reading the markdown.
  • Modify DocLink function in the sidebar logic to support highlighting the referred item.

Additional context

No response

Are you working on this?

No

benjagm avatar Oct 09 '24 04:10 benjagm

@benjagm I would like to work on this.

pavanydg avatar Oct 09 '24 05:10 pavanydg

@benjagm I would like to work on this.

Thanks a lot for your support!! Please go ahead!

benjagm avatar Oct 09 '24 06:10 benjagm

@pavanydg any progress on this ? Or any help needed ?

DhairyaMajmudar avatar Oct 15 '24 05:10 DhairyaMajmudar

@DhairyaMajmudar sorry for the delay. I was working on another issue in tour site. Will update about the progress within 2 days.

pavanydg avatar Oct 15 '24 08:10 pavanydg

@DhairyaMajmudar sorry for the delay. I was working on another issue in tour site. Will update about the progress within 2 days.

No worries, pls. take your time

DhairyaMajmudar avatar Oct 15 '24 10:10 DhairyaMajmudar

@DhairyaMajmudar so when we open this page https://json-schema.org/md-style-guide we should highlight overview/what-is-json-shema in sidebar right? I should implement only this much right?

pavanydg avatar Oct 21 '24 17:10 pavanydg

@DhairyaMajmudar so when we open this page https://json-schema.org/md-style-guide we should highlight overview/what-is-json-shema in sidebar right? I should implement only this much right?

yep, also pls. check for such more pages whose direct link is not given in the sidebar :)

DhairyaMajmudar avatar Oct 22 '24 19:10 DhairyaMajmudar

@DhairyaMajmudar i am thinking of creating a new funciton where we can refer the navbar item to be highlighted when we open a page without navbar item. Any suggestions?

pavanydg avatar Nov 29 '24 20:11 pavanydg

@DhairyaMajmudar @benjagm May I work on this issue, there is no activity from last month

techmannih avatar Dec 27 '24 09:12 techmannih

Thank you @techmannih for showing your interest but it seems you already have a good number of issues assigned here and in conference repo. please resolve them first taking new one.

Also @pavanydg what are the updates on this, you need any help ?

DhairyaMajmudar avatar Dec 27 '24 09:12 DhairyaMajmudar

@DhairyaMajmudar @benjagm i need help on this one. Like i have to extract the data from .md files to check if it has parentNav or not to check whether this is a sidebaritem or not. (this can be done using getStaticMarkdownProps) I can do this but won't it be unecessary as almost all pages won't have parentNav. So please give me some suggestions on how i should do it.

pavanydg avatar Dec 30 '24 17:12 pavanydg

Hello @DhairyaMajmudar and @benjagm , this issue seems to have no updates. I would like to take this up!

Karan-Palan avatar Jan 21 '25 19:01 Karan-Palan

@pavanydg if you're not working on this shall I assign this issue to Karan ?

DhairyaMajmudar avatar Jan 22 '25 04:01 DhairyaMajmudar

Any updates?

Karan-Palan avatar Feb 03 '25 19:02 Karan-Palan

@Karan-Palan I am not working on this right now. You can take it up.

pavanydg avatar Feb 03 '25 19:02 pavanydg

@Karan-Palan I am not working on this right now. You can take it up.

Sure I'll wait for an assignment from @DhairyaMajmudar or @benjagm

Karan-Palan avatar Feb 03 '25 19:02 Karan-Palan

@Karan-Palan still interested in taking this up?

DhairyaMajmudar avatar Mar 10 '25 06:03 DhairyaMajmudar

Yeah! Just done with exams, have ample of time

Karan-Palan avatar Mar 10 '25 06:03 Karan-Palan

@DhairyaMajmudar @benjagm , this issue has been resolved as we can observe the requested functionality on our website. So, I think we can close this issue.

Utkarsh-123github avatar May 23 '25 04:05 Utkarsh-123github

The issue still seems to be not done yet : )

See the sidebar is not opening for the page https://json-schema.org/md-style-guide

Image

DhairyaMajmudar avatar May 24 '25 04:05 DhairyaMajmudar

Ah, I see! I believe I may have misinterpreted what I observed earlier—apologies for that :)

Utkarsh-123github avatar May 24 '25 04:05 Utkarsh-123github

@Utkarsh-123github can you please work on this issue?

benjagm avatar May 31 '25 09:05 benjagm

@benjagm I'd love to work on this 🚀

Utkarsh-123github avatar May 31 '25 09:05 Utkarsh-123github

Hi @Utkarsh-123github , as discussed let's do the following:

  • In this case remove the sidebar.
  • For the release notes subsections mark the release notes item in the sidebar: https://json-schema.org/specification/release-notes

benjagm avatar Jul 04 '25 09:07 benjagm