Closed egnwd closed 2 years ago
Just seen that this is likely a duplicate of https://github.com/backstage/mkdocs-monorepo-plugin/issues/2, but I'll leave it open as I do believe this is a bug and not many details were added to the other issue - but happy to be told otherwise
@emmaindal I commented on #2. I really like this plugin but I need to be able to display the correct edit url for the submodules I have included.
I see you added the help wanted label. I haven't checked the code yet. could you shortly summarize what needs to be done to get this working? have you already had a look into the issue?
could you shortly summarize what needs to be done to get this working?
Hey @marc0olo! Appreciate your willingness to help out on this. Here's my understanding of how things work:
repo_url
and edit_uri
to generate the final edit URL.page.edit_url
in the theme per these docs, which is what gets printed out.Given the above, it makes sense that sub-documentation gets a broken URL because the repo_url
and edit_uri
are fixed configs at the root mkdocs.yml
. To work around this, we'll need to do a couple of things...
page.edit_url
according to the current page and that sub-documentation directory structure state from above. See on_pre_page docs here.I would also highly recommend cherry-picking @egnwd's test fixture commit and adding a test case in test.bats
in the integration tests folder.
Hope that's enough to get you started!
Based on the information @iamEAP has provided, is this issues something you would like to pick up? @marc0olo I've not looked into the problem myself yet but we will do, just wanted to check in with you first! If you want to work on it let us know and we can assign you to the issue.
hey @emmaindal, currently I don't have a plan to cover this. decided to go another route finally as we had more important stuff to focus on
Totally understand @marc0olo, we will pick this up in our team. Thank you!
Steps to Reproduce
I've added a sample docs folder that reproduces this issue.
1. Checkout to [this branch](https://github.com/egnwd/mkdocs-monorepo-plugin/tree/bug-edit-uri) 2. `cd __tests__/integration/fixtures/bug-include-path-edit-uri` 3. `npx @techdocs/cli build` 4. Inspect the `index.html` and `test/index.html` generated in the `site` folder
The top level docs is correct, the edit url generated is: https://github.com/egnwd/mkdocs-monorepo-plugin/edit/bug-edit-uri/__tests__/integration/fixtures/bug-include-path-edit-uri/docs/index.md The sub-docs is incorrect, the edit url generated is: https://github.com/egnwd/mkdocs-monorepo-plugin/edit/bug-edit-uri/__tests__/integration/fixtures/bug-include-path-edit-uri/docs/test/index.md
Note the ending should be
.../api/docs/index.md
but is.../docs/test/index.md
which is its location once the merger has aggregated the folders and named them after thesite_name
.
I have followed the above repo steps and it is still generating the incorrect edit_uri
(as above).
@iamEAP @camilaibs is it possible that this has regressed?
Note, the @techdocs/cli --version
is 1.4.5
Expected Behaviour
When creating documentation with the monorepo plugin I expect to be able to include sub-documentation and have the edit link on the final page be correct.
Current Behavior
When I load a page generated from the sub-documentation the ✏️ Edit link is incorrect, taking me to a 404.
Steps to Reproduce
I've added a sample docs folder that reproduces this issue.
cd __tests__/integration/fixtures/bug-include-path-edit-uri
npx @techdocs/cli build
index.html
andtest/index.html
generated in thesite
folderThe top level docs is correct, the edit url generated is: https://github.com/egnwd/mkdocs-monorepo-plugin/edit/bug-edit-uri/__tests__/integration/fixtures/bug-include-path-edit-uri/docs/index.md The sub-docs is incorrect, the edit url generated is: https://github.com/egnwd/mkdocs-monorepo-plugin/edit/bug-edit-uri/__tests__/integration/fixtures/bug-include-path-edit-uri/docs/test/index.md
Note the ending should be
.../api/docs/index.md
but is.../docs/test/index.md
which is its location once the merger has aggregated the folders and named them after thesite_name
.