-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Search for iOS and Android inside the same docsify server #2091
-
Hi,
I'm currently trying to make search work withing a docsify setup which look like this:
-- docsify
-- index.html
-- _sidebar.md
-- README.md
-- other .md files
-- iOS
-- README.md
-- _sidebar.md
-- other .md files
-- Android
-- README.md
-- _sidebar.md
-- other .md files
I'de like to configure search so that when I'm viewing the iOS/Android folders, it only search inside the respective directory.
When I'm viewing the root README.md from above, I'd like search to only work for files on that respective level (no iOS / Android folder .mds related results).
Is this possible with the current plugin ? And if not, is it easy to develop some custom functionality for the existing plugin to be able to achieve something like this ?
Any hints and ideas are highly appreciated,
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
You should use the search plugin's pathNamespaces option. Here is an example:
`// Docsify
window.$docsify = {
...
search: 'auto',
// Search configuration parameters
search: {
pathNamespaces: ['/iOS', '/Android'],
},
...
}`
Basically, Docsify will create multiple indexes for each search context (iOS, Android in your case) based on the prefixes specified in the pathNameSpaces
param.
Beta Was this translation helpful? Give feedback.