Hugo Narrow 支持三处导航菜单:
- 顶部菜单(main)
- 页脚菜单(footer)
- 社交链接菜单(social)
其中 icon 为标题前图标,使用 SVG 格式,放置在 hugo-narrow/assets/icons/ 目录下,使用文件名作为参数值引用。
提示
可以在 Iconify Design 找到更多优质图标。
name 值默认使用 i18n 翻译文件键值,你可以更改为任意字符串,并在翻译文件中添加翻译值。
exampleSite/config/_default/menus.yaml
1main:
2 - name: nav.posts
3 pageRef: /posts
4 weight: 20
5 params:
6 icon: posts
7 - name: nav.projects
8 pageRef: /projects
9 weight: 25
10 params:
11 icon: projects
12 - name: nav.categories
13 pageRef: /categories
14 weight: 30
15 params:
16 icon: categories
17 - name: nav.tags
18 pageRef: /tags
19 weight: 40
20 params:
21 icon: tags
22 - name: nav.archives
23 pageRef: /archives
24 weight: 50
25 params:
26 icon: archive
27
28# footer menu
29footer:
30 - name: About
31 pageRef: /about
32 weight: 10
33 params:
34 icon: about
35 - name: Contact
36 url: https://google.com
37 weight: 20
38 params:
39 icon: contact
40 - name: RSS Feed
41 url: /index.xml
42 weight: 30
43 params:
44 icon: rss
45
46# social link
47social:
48 - name: GitHub
49 url: https://github.com/username
50 weight: 10
51 params:
52 icon: github
53 - name: Twitter
54 url: https://twitter.com/username
55 weight: 20
56 params:
57 icon: twitter
58 - name: LinkedIn
59 url: https://linkedin.com/in/username
60 weight: 30
61 params:
62 icon: linkedin
63 - name: Email
64 url: mailto:your.email@example.com
65 weight: 40
66 params:
67 icon: email