mirror of
https://github.com/imfing/hextra.git
synced 2025-07-15 16:31:30 -04:00
Compare commits
6 Commits
v0.8.0
...
0d896b7e23
Author | SHA1 | Date | |
---|---|---|---|
0d896b7e23 | |||
ff565f2077 | |||
33dbd4561c | |||
2355432542 | |||
24a2734ee5 | |||
1313415c8b |
@ -251,6 +251,23 @@ Options for `flexsearch.index`:
|
||||
- `heading` - level 1 and level 2 headings
|
||||
- `title` - only include the page title
|
||||
|
||||
To customize the search tokenize, set the `params.search.flexsearch.tokenize` parameter in the config file:
|
||||
|
||||
```yaml {filename="hugo.yaml"}
|
||||
params:
|
||||
# ...
|
||||
flexsearch:
|
||||
# full | forward | reverse | strict
|
||||
tokenize: forward
|
||||
```
|
||||
|
||||
Options for [`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search):
|
||||
|
||||
- `strict` - index whole words
|
||||
- `forward` - incrementally index words in forward direction
|
||||
- `reverse` - incrementally index words in both directions
|
||||
- `full` - index every possible combination
|
||||
|
||||
To exclude a page from the search index, set the `excludeSearch: true` in the front matter of the page:
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
|
@ -219,6 +219,25 @@ params:
|
||||
- `heading` - 一级和二级标题
|
||||
- `title` - 仅搜索标题
|
||||
|
||||
要自定义检索分词,请在配置文件中设置`params.search.flexsearch.tokenize`:
|
||||
|
||||
```hugo.yaml
|
||||
params:
|
||||
# ...
|
||||
flexsearch:
|
||||
# full | forward | reverse | strict
|
||||
tokenize: forward
|
||||
```
|
||||
|
||||
[`flexsearch.tokenize`](https://github.com/nextapps-de/flexsearch/#tokenizer-prefix-search)的可选项:
|
||||
|
||||
- `strict` - 严格单词匹配
|
||||
- `forward` - 单词前缀匹配
|
||||
- `reverse` - 单词前后缀匹配
|
||||
- `full` - 单词子串匹配。
|
||||
|
||||
> 在默认的分词逻辑下,中文一句话就是一个“单词”
|
||||
|
||||
要从搜索索引中排除页面,更改 front matter 中的 `excludeSearch: true`:
|
||||
|
||||
```yaml {filename="content/docs/guide/configuration.md"}
|
||||
|
17
exampleSite/content/docs/guide/shortcodes/pdf.md
Normal file
17
exampleSite/content/docs/guide/shortcodes/pdf.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: Pdf
|
||||
---
|
||||
|
||||
## Example
|
||||
{{< pdf "https://dagrs.berkeley.edu/sites/default/files/2020-01/sample.pdf" >}}
|
||||
|
||||
## Usage
|
||||
### With URL
|
||||
```
|
||||
{{</* pdf "https://dagrs.berkeley.edu/sites/default/files/2020-01/sample.pdf" */>}}
|
||||
```
|
||||
|
||||
### With Path
|
||||
```
|
||||
{{</* pdf "path/to/your/pdf/file.pdf" */>}}
|
||||
```
|
Reference in New Issue
Block a user