[Bug] ButtonLink component doesn't "see" navigation.redirect
See https://github.com/mathieunicolas/docus-issue for the code.
The only thing I modified is the aside level : docus.aside.level: 1
I just wanted to use a button-link on the main page to the root of a subfolder (same as if I clicked on the top navbar), but it looks like there's something I don't understand
The problem
I run npm run dev:
-
test-atop navbar : all is ok -
test-btop navbar : all is ok -
test-ctop navbar : redirected totest-a(priority tonavigation.redirectoverredirect) -
test-abutton-link : thetest-aindex (no redirection) -
test-bbutton-link : all is ok -
test-cbutton-link: redirected totest-b(priority toredirectovernavigation.redirect
Now I run npm run generate and I upload the output to netlify : https://visionary-rugelach-3018e9.netlify.app/
The behaviour is different :
-
test-atop navbar : all is ok -
test-btop navbar : 404 -
test-ctop navbar : redirected totest-a -
test-abutton-link : thetest-aindex (no redirection) -
test-bbutton-link : 404 -
test-cbutton-link: 404
The structure
Here is my content folder structure :
.
├── 0.index.md
├── 1.test-a
│ ├── 0.index.md
│ └── 1.redirected.md
├── 2.test-b
│ ├── 0.index.md
│ └── 1.redirected.md
└── 3.test-c
├── 0.index.md
└── 1.redirected.md
in the root 0.index.md, there's 3 button-link:
:button-link[test-a]{href="/test-a" style="margin: 1rem;"}
:button-link[test-b]{href="/test-b" style="margin: 1rem;"}
:button-link[test-c]{href="/test-c" style="margin: 1rem;"}
In /1.test-a/0.index.md :
---
navigation.redirect: /test-a/redirected
---
# test-a welcome
In /2.test-b/0.index.md :
---
redirect: /test-b/redirected
---
# test-b welcome
In /3.test-c/0.index.md :
---
navigation.redirect: /test-a/redirected
redirect: /test-b/redirected
---
# test-c welcome
I updated my issue, I'm sorry I didn't take the time to explain as I should have to in the first draft.
@farnabaz any idea about this one?
I need to dig into it, but it seem to be related to Content?
I agree that there is a bit of ambiguity and conflict between redirect and navigation.redirect
-
redirectuses when user navigates to the page -
navigation.redirectuses to determine nav item link
So in test-c:
- inside nav bar the link will use
navigation.redirectand it will not care aboutredirect - inside button, when user hit the button, it will directly go to
test-cthen in the page it will useredirectand will not care aboutnavigation.redirect
Let's discuss about the perfect behaviour and combination of these two before changing anything.
WDYT @Tahul ?
I don't know if I can help, but my usecase is simple : with Docus I make a website I use with my students. At the beginning of each hour, they go the the website, then click on their class, and I'd like to define a redirect from the index of their class to the "page of the day", redirect I could update each week. And some students click on the top navbar, some students click on the CTA of the first page BlockHero. That's how I noticed the differences
That's why I also want to be able to collapse all the nodes in the asideTree except the one that contains the page of the day. That's why I also made an issue related to useDocus(), that may overwrite the collapsed state of the asideTree nodes.
Let me know if I can help more !