Skip to content

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

Open
@benjagm

Description

@benjagm

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

Metadata

Metadata

Labels

HacktoberfestIssues accepeted Hacktoberfest'24Status: In ProgressThis issue is being worked on, and has someone assigned.✨ EnhancementIndicates that the issue suggests an improvement or new feature.

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions