Closed JuanPabloDiaz closed 8 months ago
Thanks to the Docsify community, I was able to resolve the issue.
I modify the script by:
namespace: 'devKit'
routerMode: "history"
Add a
namespace
if you have another Docsify site open online using the same domain. This could cause issues with namespace not being unique. Theroutermode
seems to conflict with the search functionality when on GitHub Pages. Removing that seems to result in the Search working online.
In summary, my working script ends up been:
window.$docsify = {
name: "DevKit",
repo: "JuanPabloDiaz/devKit",
search: {
paths: "auto",
namespace: "devKit", // To avoid search index collision between multiple websites under the same domain
depth: 0, // index all headers and content - To enable full-text search
// routerMode: "history", // use 'hash' instead to avoid `search error` on Github pages https://github.com/JuanPabloDiaz/devKit/issues/4
placeholder: "Search Free Resources",
noData:
'<h3 style="text-align: center;"><i>No results! 🤔</i></h3> <br><h4 style="text-align: center; color: orange;"><a href="https://github.com/JuanPabloDiaz/devKit/pulls" target="_blank">Open a PR to add new resources</a></h4>',
},
darklightTheme: {
siteFont: "Source Sans Pro, Helvetica Neue",
defaultTheme: "light",
codeFontFamily: "Roboto Mono, Monaco, courier, monospace",
bodyFontSize: "15px",
},
};
For some reason the search bar does not work on the production site but it does work on my localhost
any search throw error message: "No Results!"
I already modify several times the script in the
index.html
file. I tried:depth: 0