-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to make the sidebar & outline management more DRY? #138
Comments
Yes - Docusaurus has built-in solution for this. There are a few limitations:
The outline should appear on the left side and should scroll with the content. Is that not happening for your docs? You can configure how many levels are captured by the outline. The docs are here. I'm not sure if you specifically want the outline to appear in the body of the
We were struggling with naming conventions and were trying to balance viewing in GitHub, on your dev machine and on doc.gruntwork.io. We thought that prefacing with I also have a local tool that I can use to help you generate a
You don't have to do this unless you want to specifically override what shows up in the "back" and "next" buttons that appear at the bottom of your articles. If you don't override then it will use the first
You don't have to specify anything in the frontmatter unless your |
Minor correction — the outline (technically, TOC) — appears to the right of the page content. It should appear automatically. It can be embedded in the body of the document, but I'm not sure when there would be a need. You can also configure the depth using front matter, but by default it shows
To be clear, we've explicitly decided to standardize on the |
Thank you both, that's very helpful. I was able to make things a bit more DRY following Eugene's advice. See #145. Note that, IMO, there are reasons to put an outline right in the body of the doc: namely, in an introductory section that says, "here's the outline of what we'll be discussing today." See https://deploy-preview-145--pensive-meitner-faaeee.netlify.app/docs/guides/production-framework#lets-get-started for an example. |
Also, I think this issue can be closed. |
I was working on a guide for the Production Framework, with the hope of having the sidebar on the left and an outline of the content in the first part of the article too, and as best as I can tell, this requires the following:
sidebars/production-framework-guide.js
and copy/paste the file/folder structure into it, and manually keep it in sync as new files are added/removed.pagination_label
in some of the.md
files. Not sure what happens if I don't?# <title>
and in the front matter..md
file. I didn't see a way to generate this programmatically?Note that I'm not sure I'm doing this right; I was basically copying the Ref Arch guide structure and used a lot of trial and error to get this working. So if there's a simpler way, LMK!
Is there any way to just create the files on disk and have (a) the sidebar created automatically and (b) a programmatic way to have an outline in the body too?
The text was updated successfully, but these errors were encountered: