retype
retype copied to clipboard
Add optional sections to the left sidebar
Hello!
I was wondering if you would consider adding optional sections to the left sidebar?
Currently, I can easily add multiple level of collapsible folders:
root
/folder A
/folder AA
/folder AAA
page
/folder B
.....
What I would like to do is separating those folders by sections:
root
Section 1
/folder A
/folder AA
/folder AAA
page
/folder B
Section 2
/folder C
Similar to how Storybook is doing it:
But maybe with a look that is more similar to React Spectrum:
One use case that we currently have is for the following Retype website: https://gsoft-inc.github.io/wl-web-configs/ for which at some point we will deprecate tools that we stopped using. We would like to keep the tool documentation but move it to a "Legacy" section at the bottom of the sidebar:
web-configd
/browserslist
/eslint
/stylelint
.....
Legacy Section <---
/postcss
Another use case, is for our future "hub" website for which we will want to distinguish our backend and frontend documentation sites in the sidebar, something like:
hub
Backend
...
Frontend
web-configs (link to https://gsoft-inc.github.io/wl-web-configs/)
@squide (link to https://gsoft-inc.github.io/wl-squide/)
...
Let me know what you think!
Thank you
Another example from the new Bun 1.0 documentation :)
This is the best I have been able to come up with so far with Retype:
It could be configured with a default.md or index.yaml file.
A type option could be added, accepting either a folder or section value. Default would be folder.
~~If you decide to work on this feature, that would also be appreciated if the links of the sections could refer to external links.~~
~~Given the follow hub:~~
~~If I want to add links refering to the "Squide" and "Web configs" sites to my left sidebar:~~
sidebar
├── Frontend
├──── Squide
├──── Web configs
~~I must use the redirect property:~~
---
label: "Squide"
redirect: https://gsoft-inc.github.io/wl-squide
---
~~That's not great because it's a JavaScript redirect rather than a native hyperlink.~~
Thank you,
Patrick
Another thing that could be great if you choose to work on this, would be to statically render the new sections and links rather than relying on JavaScript as it's currently done.
With the current implementation, when navigating between the hub sites, there is a loading time before the sidebar is displayed that could be avoided if the sections and link were statically generated:
Spectrum hub's sites are all statically generated. Here's the result of a similar test:
Let me know what you think!
Thank you,
Patrick
That's not great because it's a JavaScript redirect rather than a native hyperlink.
The js redirect is only if the page is browsed to directly. Retype will replace any links within the project that link to the .md file with a static link directly to the external URL and not the .md page. So unless the page is directly linked into from an external source, the js redirect will not be triggered.
That's not great because it's a JavaScript redirect rather than a native hyperlink.
The js redirect is only if the page is browsed to directly. Retype will replace any links within the project that link to the
.mdfile with a static link directly to the external URL and not the.mdpage. So unless the page is directly linked to, the js redirect will not be triggered.
Oh, you're right, sorry my bad!