Closed paschalidi closed 4 years ago
Project | ui-core |
Status | Passed |
Commit | 40410a4146 |
Started | Apr 14, 2020 3:56 PM |
Ended | Apr 14, 2020 4:02 PM |
Duration | 06:39 💡 |
OS | Linux Ubuntu Linux - 18.04 |
Browser | Electron 78 |
View run in Cypress Dashboard ➡️
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard
Thanks! I guess the hash is considered part of the root, and then it appends the root relative url to that? The fix does mean that the links in the api docs will now always point to the live production docs. So the links in PR builds will now also point to the 'production' docs, whereas previously they'd link to the docs from the PR. So:
I haven't looked into what's going on with the jsdocs. Maybe the routing there could be changed from hash routing? That'd allow us to get rid of the hash.
The documentation build is done by https://github.com/dhis2/cli-utils-docsite, so if we want to change anything I assume we'd have to change it there. I'm sure of the history of our doc builds though, and what the plans are. I think @amcgee and @varl know more about that.
Thanks! I guess the hash is considered part of the root, and then it appends the root relative url to that? The fix does mean that the links in the api docs will now always point to the live production docs. So the links in PR builds will now also point to the 'production' docs, whereas previously they'd link to the docs from the PR. So:
- With the fix it points to: https://ui-core.dhis2.nu/demo/?path=%2fstory%2falertbar--default
- but this PR's build is actually at: https://deploy-preview-877--dhis2-ui-core.netlify.com/demo/?path=%2fstory%2falertbar--default
I haven't looked into what's going on with the jsdocs. Maybe the routing there could be changed from hash routing? That'd allow us to get rid of the hash.
Yeah you right havent thought of that. Apologies.
Best would be as you say to remove the hash. However, do know @ismay what is the use of the hash?
Actually, my assumption was wrong. The problem is with the generated html. It's generated by https://docsify.js.org, which prepends the hash, so it turns this:
/demo/?path=/story/alertbar--default|Storybook
into this:
<a href="#/demo/?path=%2fstory%2falertbar--default">Storybook</a>
The hash is used for docsify's routing, but it shouldn't be prepended for these links. I'll look into if it can be omitted somehow. Will report back.
Thanks for taking the initiative! Will be willing to help dont hesitate to ask
I think that this is what we're looking for https://docsify.js.org/#/configuration?id=nocompilelinks. And our docsify configuration can be found here: https://github.com/dhis2/cli-utils-docsite/blob/master/template/js/initDocsify.js
I assume that setting:
noCompileLinks: ['/demo/.*']
would solve our issue. (Or something of that nature, I don't know precisely what glob syntax they expect)
We could also change the router mode, but that would require us to configure redirects, so the above might be the simplest option.
@paschalidi I'm hoping that this'll do the trick: https://github.com/dhis2/cli-utils-docsite/pull/47
cool! I am closing this! Thanks for taking care of it!!
cool! I am closing this! Thanks for taking care of it!!
N.p., thanks for picking this up (I'm not sure whether my proposed fix is how we want to fix it btw., but we'll see).
Thanks again for the PR, it's easy to miss these kinds of hiccups with documentation, much appreciated 👍!
👋 hello!
This is my first PR without opening an issue. Maybe I should have opened one first. Feel free to give me your feedback both on the code and the procedure anyways!
The issue description:
While I was navigating at the ui-core docs I realised that clicking on the Live demo link would return a 404 page instead of the story.
The problem is that we are having this
/#/
on the url and therefore the link is broken. I added the full link to fix this issue however I can imagine that there might be a better solution to this! Le me know your thoughts and feedback!