-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
[Docs Bug 🐞 report]: Automate the Prev and UpNext buttons for Docs #1000
Comments
So the upnext in https://www.asyncapi.com/docs/tutorials/streetlights-interactive should be linked to https://www.asyncapi.com/docs/tutorials/streetlights ? |
Hey can I contribute to this issue? @akshatnema |
There are many changes related to this and also regarding the overview pages for each subtopic. All of them will be covered in this issue.
Surely @manavdesai27, you can contribute to the issue. Let us first have approval from @derberg and @alequetzalli. |
basically what I can observe over here is that we need to provide buttons in the overview section and correctly the buttons in every page. Right? |
Hey @akshatnema this is actually 3 different bugs listed under one issue... Can you at least create 3 tasks in this same issue to help make it more digestible? 😜🙌🏽 I also recommend thinking of a new title that better encapsulates the 3 items you discuss. 👍🏽👍🏽 As for adding Prev/Next buttons on each content bucket |
Yes, exactly, but we have to make sure that whether it is needed on the
Hmm, if I look into the issue, I don't think it can be converted into the more digestible issues, because with each page, there is only 1 line page and making a different issue for each line page, I won't prefer that. Rest I will like to have an opinion with @derberg. Secondly, I haven't mentioned all the link changes in this issue because it is self-defined from the tree diagram inside the docs side bar how the pages should be linked with each other. So, I will like to make sure that we don't have spam of PRs with just a one-two liner change in a page. Better I would go with code-related contribution with this as we already have a component designed for these buttons. You can probably look on this line: |
@manavdesai27 working on this one? |
Yes, I'm working on this issue. |
@manavdesai27 okay you take this one. |
Where should I point the I am attaching the screenshot below for your reference: |
Take into account that bugs will sooner or later appear again, because the more docs will arrive, so I would advise to go in the direction of automatically checking the prev/next pages and generate prev/next button based on that. I don't remember exactly if we already have the necessary metadata during rendering, but we can always generate it at generation step from docs mdx to JSONs. |
@magicmatatjahu We don't have any predefined sequence or tree specified in the codebase. So, how can we automate the prev and next buttons according to the docs tree specified right now? |
@akshatnema during the restructuring of docs @alequetzalli also handled netlify redirects configuration for old paths, to make sure they still work. This is why it works even if path is wrong 😄
we have
very good assumption @alequetzalli 😄
yeah, we have a bit of mix here. I think we agree that best solution is to automate. This is not as trivial as just first fixing these next/prev buttons manually. I recommend this issue stays for This way we will validate if making it automated using |
But tbh, it's not a good way right now. Because if you try to access the page in development mode, it broke down giving a 404 page as redirection is not set there.
Ok, let's make this issue specific to |
well, I didn't say it must stay like this 😄 redirects were done for people linking to AsyncAPI website from outside. I just explained why it works 😄 this link should definitely be fixed in the markdown file.
@manavdesai27 is super motivated to do both issue, so let us leave |
Yeah sure, I will first work on issue #1014 . And then come back to this. That issue won't take much time to fix. @derberg |
@manavdesai27 @alequetzalli I have updated the issue description according to the need. Kindly look into it. |
hey folks, IMHO we need 2 mechanisms:
wdyt? |
Both options LGTM |
📢📢📢 YES, I love this one, this is a good idea.
wait what? sorry, I feel confused and don't think I understand this point.. can I bother you to explain it more to me, @derberg ? 😬😂😂 |
It basically means that by default it is based on title: My cool doc
weight: 10
nav_buttons:
next: /docs/concepts/channel
previous: /docs/concepts/application then values for buttons will be taken from above front matter. |
@derberg @alequetzalli what if we make an object of posts copied/calculated using the DocsNav |
in the end this tree is build upon the |
Nope, that's the most surprising thing I got today. Docs are not entirely sorted using weights. We have not provided any global or sequential parameter to sort the doc. So, the tree is made using appending of children inside each root section and subsection. |
have a look at https://github.com/asyncapi/website/blob/master/components/layout/DocsLayout.js#L26 where we build the tree. We are sorting by few properties, in the end, navigation is build from weights. And yes, it doesn't make sense to write separate new logic to identify next/prev basing on weight if we already have it in the navigation tree, so just reuse |
@derberg Look at this image carefully. This is the data inside the navigation only. If we look deeply, it is not sorted properly. This is not exactly according to the weight sorted docs. |
the first image is console log from browser? maybe by default it orders object keys alphabetically in the browser dev tools? |
Yeah maybe, not sure about it, and also, we don't have to do the computation stuff regarding the addition of prev and next fields in the |
Sure, just keep in mind that can be done as separate refactor task for other contributors |
This appears to be a common question in the internet 😄 .. lots of blog posts and StackOverflow threads mention it Perhaps this can help?
|
Describe the bug you found in AsyncAPI Docs.
Every time we update the docs or add a new doc inside documentation, we have to add
Up Next
andBack
buttons for each page or update them to the latest. Make the buttons in such a way that it automates itself to point to next and back pages sequentially according to the Doc tree.Remove the
DocsButton
component from each Doc page and add the component to theDocsLayout
, and implement it according to theindex
of the map function used.Attach any resources that can help us understand the issue.
Use the weight parameter to serialize the docs and then provide the routes to the buttons for each page.
Code of Conduct
The text was updated successfully, but these errors were encountered: