Closed reymon359 closed 3 years ago
You need to set the basePath
basePath: '/collman-fruits-example/',
Hi there @sy-records!
Thank you for the suggestion. I tried adding the basePath: '/docsify-sidebar-collapse/',
to the window.$docsify
object in the repo https://github.com/reymon359/collman-fruits-example index.html
file, but it didn't work. π€
I had a proper look at the docs and tried these too(without success):
basePath: '/',
basePath: '/docsify-sidebar-collapse/',
relativePath: true,
basePath: '/collman-fruits-example/',
In the end this one worked. However, I feel it is a bit unnecessary to add the full raw URL path.
Thank you again for the help and have a great day full of meat π ! π
This method is ok if the git repo is publicly accessible. If its in an organization and is private it wont work. That's what happened to me.
I too faced the same issue of blank sidebar. After a quick inspect of webpage in chrome I found that when page is hosted, _sidebar.md was facing a fall back issue since it was loaded from each level directory.
The fix that worked for me was to use Nested Sidebar. I just added alias with the intex.html and my issue got fixed.
<script> window.$docsify = { loadSidebar: true, alias: { '/.*/_sidebar.md': '/_sidebar.md' } } </script>
Please try and see if this works
Just found out that gh-pages is not serving the _sidebar.md
files. It seems that it is ignoring files that start with an _
( caused by Jekyll
). Solution is to add a .nojekyll
file at the root.
More on this https://medium.com/@juliakmdev/learning-that-github-pages-struggles-with-certain-file-names-4d867d499ca9
@jellehak thanks for sharing, yes that solves the issue π
Can calso onfirm that adding .nojekyll
to the project root solves this problem
Bug Report
The sidebar dissapears and the search stops working when deploying to GitHub Pages
I already submitted an issue in the plugin repo https://github.com/iPeng6/docsify-sidebar-collapse/issues/29, however I decided to submit it here too in case someone can help π
Steps to reproduce
docsify serve docs
to see how it works locallyWhat is current behaviour
The sidebar is not being displayed when deployed to Github Pages
However it works locally
What is the expected behaviour
The sidebar should appear when deployed to GitHub Pages the same way it works locally
Other relevant information
Please create a reproducible sandbox
Mention the docsify version in which this bug was not present (if any)