question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

front matter option "displayed_sidebar" & "hide_sidebar"

See original GitHub issue

🚀 Feature

Have you read the Contributing Guidelines on issues?

Yes

Has this been requested on Canny?

No

Motivation

We have two item types: doc which creates both the sidebar association and the link, ref which creates just the link but not association (the sidebar will not show up on that page). We naturally want a third: association that creates the association but not the actual link.

Use-case: home pages of docs sites would use the sidebar as navigation, but itself shouldn’t necessarily appear in that sidebar (typically we go back by clicking the logo or using a navbar link).

API Design

A new sidebar item type association would be sufficient. It might still take all the props of doc or ref for uniformity (we won’t throw during validation), but they don’t do anything.

The association item can be declared anywhere in the sidebar, because it doesn’t go into the rendered structure.

Have you tried building it?

It would literally be just 20 lines of code in the doc metadata generation logic. But I’ll be implementing this after the category index page thing (or at least after #5678)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14

github_iconTop GitHub Comments

1reaction
Josh-Cenacommented, Oct 20, 2021

I mean,

---
sidebar: sidebarA
hide_sidebar:
  mobile: true
  desktop: false
---

Or:

---
sidebar: sidebarA
hide_sidebar: true
---

Assigning different sidebars on desktop and mobile makes navigation quite confusing IMO, and it also makes the doc’s metadata unnecessarily different from before.

1reaction
Josh-Cenacommented, Oct 17, 2021

Actually, I think there are many other layout-related metadata that can accept desktop + mobile (hide_table_of_contents for example). This would be a good place to start.

However, as I looked through relevant source code, I think it’ll make more sense if we make two front matter options: hide_sidebar and sidebar. The former will accept screen-size-based config while the latter just associates the doc to a sidebar. This ensures that we don’t complicate the doc’s metadata and separates “data” from “presentation”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Remove the Sidebar in WordPress - WPBeginner
We'll show you how to delete the sidebar from your entire site, and how to hide the sidebar on a specific page or...
Read more >
Customize your sidebar to show inboxes, tags, teammates ...
To quickly hide a tag from your sidebar, hover over the tag and click the three dots to the right of the tag...
Read more >
Customize Your Sidebar and Limit Front Matter Templates to ...
You can now decide which sections are visible by using our hidden tag. Also, your content sections will appear in the exact order...
Read more >
Sidebar | vuepress-theme-hope
You should use sidebar in theme options to control sidebar. ... You can disable the sidebar on a specific page with YAML front...
Read more >
How To Hide Sidebar And Create Full Width Post ... - YouTube
Hi everyone, welcome to live blogger. In this video, we'll see how to hide the sidebar and create full-width posts in #WordPress, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found