Comments (2)
一个简单的 hack
你可以自行编写一个 input 组件,然后点击搜索时利用 docusaurus/router
的路由能力跳转到 /search
,查询的内容(以“xxx”为例子)使用 url params 携带,一个例子如下:
your-site-name/search?q=xxx
这样可以跳转到插件内置的搜索结果页。
为什么这么做?
由于这个插件没有暴露出内部的 api 或者搜索框组件,所以不能在外部直接调用这部分的能力。
from docusaurus-search-local.
You can try like this, in which the author seems swizzled @theme/DocSidebar/Desktop
and @theme/Navbar
, moved SearchBar
from Navbar
to DocSidebar
.
from docusaurus-search-local.
Related Issues (20)
- Support customizing the search
- Build error occurs when docusaurus version >=2.2.0
- Plugin seems to break in docs-only mode HOT 1
- After build "Couldn't Found search-index.json" error shows. HOT 10
- Question: is it possible to ignore a folder? HOT 2
- [Question] Independent extract search feature into another website
- pnpm build: Docusaurus server-side rendering could not render static page with path
- How to solve the type checking error in vscode? HOT 2
- I'm not able to swizzle the Search component. HOT 1
- Option to use custom icon for search HOT 3
- build fail when add slug: filename.html
- Search icon doesn't change color between light/dark mode HOT 1
- Allow Search to open details html tag
- Japanese search problem
- Add theme option to set the search bar placeholder message
- Docusaurus `tags` make search results incorrect and unreadable
- [Bug] - CI Fails when Used with Docusaurus 2.4.0
- `blogDir` allows `[]`
- No index entry generated for custom categories specified in sidebars.js
- Should search find documents based on front-matter keywords? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docusaurus-search-local.