adrianvlupu / C4-Builder

This is a documentation builder. You feed it .md and .puml and it exports a site, pdf, or a markdown with navigation.
https://adrianvlupu.github.io/C4-Builder/
MIT License
562 stars 93 forks source link

_sidebar.md gets 404 for any file not in the root of the distFolder #52

Closed GregEisenberg closed 2 years ago

GregEisenberg commented 2 years ago

Root issue: _sidebar.md gets 404 for any file not in the root of the distFolder

Context: We are following the source layout example provided in the readme and using the sidebar=true option. After building, the distFolder has a file called _sidebar.md. The top level index.html and Home.md file renders perfectly and work correctly. However for every page in any subfolders of the distFolder, they fail to find _sidebar.md because those subfolder do not have that file. Looking at the web debugger is that it seems to make requests for _sidebar.md once per level in the tree.. but no request from a page below the root of distFolder makes the request for the topmost.

Its possible that what I am hitting is really https://github.com/docsifyjs/docsify/issues/1713 but wanted to call it out here too.

GregEisenberg commented 2 years ago

Per comments provided to me in here adding

      "alias": {
        '/.*/_sidebar.md': '/_sidebar.md'
      },

in index.html's window.$docsify object did fix the issue. Looking to see if i can find where that index.html is generated and will see if I can provide a PR, otherwise it seems the solution is clear just need to figure out how to implement it.

MickeJohannesson commented 2 years ago

It's located in the docsify.template.js file. The injection of the options are made in build.js (look for docsify homepage) I have added this one fix also into my PR #56

adrianvlupu commented 2 years ago

It should be fixed now (hopefully)

GregEisenberg commented 2 years ago

Awesome! Thanks for the reply and the updated version! Will look to test it out soon.

From: Victor Lupu @.> Sent: Tuesday, April 12, 2022 1:25 PM To: adrianvlupu/C4-Builder @.> Cc: Greg @.>; Author @.> Subject: Re: [adrianvlupu/C4-Builder] _sidebar.md gets 404 for any file not in the root of the distFolder (Issue #52)

It should be fixed now (hopefully)

- Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fadrianvlupu%2FC4-Builder%2Fissues%2F52%23issuecomment-1097181503&data=05%7C01%7C%7C90cc3d230a69426c511608da1cc282ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637853918989788822%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=NVufwMUDkeCgf0reIhAt%2FaSPNARK%2Bu5IYwuqL978crg%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGBFBWFYPEYZYS2FEJILS73VEXLZRANCNFSM5OTHMFNQ&data=05%7C01%7C%7C90cc3d230a69426c511608da1cc282ae%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637853918989945069%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=V7hgfH9wcbronzi7qteneMAw61beL8joeEi1D6pK%2B%2BY%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>