mirror of
https://github.com/imfing/hextra.git
synced 2025-08-23 10:07:11 -04:00
docs(config): add documentation for navbar dropdown menu
This commit is contained in:
@@ -43,30 +43,51 @@ menu:
|
|||||||
There are different types of menu items:
|
There are different types of menu items:
|
||||||
|
|
||||||
1. Link to a page in the site with `pageRef`
|
1. Link to a page in the site with `pageRef`
|
||||||
```yaml
|
```yaml
|
||||||
- name: Documentation
|
- name: Documentation
|
||||||
pageRef: /docs
|
pageRef: /docs
|
||||||
```
|
```
|
||||||
2. Link to an external URL with `url`
|
2. Link to an external URL with `url`
|
||||||
```yaml
|
```yaml
|
||||||
- name: GitHub
|
- name: GitHub
|
||||||
url: "https://github.com"
|
url: "https://github.com"
|
||||||
```
|
```
|
||||||
3. Search bar with `type: search`
|
3. Search bar with `type: search`
|
||||||
```yaml
|
```yaml
|
||||||
- name: Search
|
- name: Search
|
||||||
params:
|
params:
|
||||||
type: search
|
type: search
|
||||||
```
|
```
|
||||||
4. Icon
|
4. Icon
|
||||||
```yaml
|
```yaml
|
||||||
- name: GitHub
|
- name: GitHub
|
||||||
params:
|
params:
|
||||||
icon: github
|
icon: github
|
||||||
```
|
```
|
||||||
|
|
||||||
These menu items can be sorted by setting the `weight` parameter.
|
These menu items can be sorted by setting the `weight` parameter.
|
||||||
|
|
||||||
|
### Nested Menus
|
||||||
|
|
||||||
|
You can create dropdown menus by defining child menu items. Child menus appear when clicking on the parent menu item.
|
||||||
|
|
||||||
|
```yaml {filename="hugo.yaml"}
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
- identifier: sdk
|
||||||
|
name: SDK
|
||||||
|
- identifier: python
|
||||||
|
name: Python ↗
|
||||||
|
url: https://python.org
|
||||||
|
parent: sdk
|
||||||
|
- identifier: go
|
||||||
|
name: Go
|
||||||
|
url: https://go.dev
|
||||||
|
parent: sdk
|
||||||
|
```
|
||||||
|
|
||||||
|
Child menu items need to specify the `parent` parameter with the parent's `identifier` value.
|
||||||
|
|
||||||
### Logo and Title
|
### Logo and Title
|
||||||
|
|
||||||
To modify the default logo, edit `hugo.yaml` and add the path to your logo file under `static` directory.
|
To modify the default logo, edit `hugo.yaml` and add the path to your logo file under `static` directory.
|
||||||
@@ -302,6 +323,7 @@ To customize the search tokenize, set the `params.search.flexsearch.tokenize` pa
|
|||||||
|
|
||||||
```yaml {filename="hugo.yaml"}
|
```yaml {filename="hugo.yaml"}
|
||||||
params:
|
params:
|
||||||
|
search:
|
||||||
# ...
|
# ...
|
||||||
flexsearch:
|
flexsearch:
|
||||||
# full | forward | reverse | strict
|
# full | forward | reverse | strict
|
||||||
@@ -363,6 +385,7 @@ outputs:
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will generate an `llms.txt` file at your site's root containing:
|
This will generate an `llms.txt` file at your site's root containing:
|
||||||
|
|
||||||
- Site title and description
|
- Site title and description
|
||||||
- Hierarchical listing of all sections and pages
|
- Hierarchical listing of all sections and pages
|
||||||
- Page summaries and publication dates
|
- Page summaries and publication dates
|
||||||
|
Reference in New Issue
Block a user