mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-31 08:57:15 +00:00
feat: add search section into the README.md
This commit is contained in:
parent
363bb68e42
commit
102b4cea8d
1 changed files with 20 additions and 1 deletions
21
README.md
21
README.md
|
@ -23,9 +23,28 @@ $ git clone https://github.com/matcornic/hugo-theme-learn.git
|
|||
- Automatic table of contents
|
||||
- Create buttons (typically used to provide a link to a demo)
|
||||
|
||||
# Search
|
||||
To use the `search` functionality, you just have to put a `lunr` index which respects this format :
|
||||
```json
|
||||
[
|
||||
{
|
||||
"uri": "/docs/01-start/index",
|
||||
"title": "Get started",
|
||||
"content": "\n\nGet started\n\nAll you need to know...\n",
|
||||
"tags": ["start", "intro"]
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
into a `static/json/search.json` file in your hugo project.
|
||||
|
||||
And set `search = true` in your config.toml
|
||||
|
||||
To generate your lunr index, you can see this project https://github.com/gwleclerc/lunr-hugo which parse your markdown files and extract toml and yaml headers to create index with corresponding format.
|
||||
|
||||
# TODO
|
||||
|
||||
- [Handling more than 2 levels in documentation](https://github.com/matcornic/hugo-theme-learn/issues/11)
|
||||
- [Search in site](https://github.com/matcornic/hugo-theme-learn/issues/12)
|
||||
- [Handling videos](https://github.com/matcornic/hugo-theme-learn/issues/13)
|
||||
- [Add optional button to create doc issue (like github)](https://github.com/matcornic/hugo-theme-learn/issues/14)
|
||||
|
|
Loading…
Add table
Reference in a new issue