Skip to content

Hugo Narrow 支持三处导航菜单:

  • 顶部菜单(main)
  • 页脚菜单(footer)
  • 社交链接菜单(social)

其中 icon 为标题前图标,使用 SVG 格式,放置在 hugo-narrow/assets/icons/ 目录下,使用文件名作为参数值引用。

TIP

可以在 Iconify Design 找到更多优质图标。

支持通过创建语言后缀文件为不同语言创建菜单:menus.zh-hans.yaml

yaml
main:
  - name: Posts
    pageRef: /posts
    weight: 10
    params:
      icon: posts

  - name: Archives
    pageRef: /archives
    weight: 20
    params:
      icon: archive

  # Example: parent item with dropdown submenu children
  - name: More
    weight: 30
    params:
      icon: layers

  - name: Categories
    weight: 1
    pageRef: /categories
    parent: More
    params:
      icon: categories

  - name: Tags
    weight: 2
    pageRef: /tags
    parent: More
    params:
      icon: tags

  - name: Series
    weight: 3
    pageRef: /series
    parent: More
    params:
      icon: bookmark

  - name: Projects
    weight: 4
    pageRef: /projects
    parent: More
    params:
      icon: projects

# footer menu
footer:
  - name: Timeline
    pageRef: /timeline
    weight: 10
    params:
      icon: chart

  - name: About
    pageRef: /about
    weight: 20
    params:
      icon: about

  - name: Resume
    pageRef: /resume
    weight: 25
    params:
      icon: file-text

  - name: RSS Feed
    url: /index.xml
    weight: 30
    params:
      icon: rss

# footer social link
social:
  - name: GitHub
    url: https://github.com/username
    weight: 10
    params:
      icon: github
  - name: Twitter
    url: https://twitter.com/username
    weight: 20
    params:
      icon: twitter
  - name: LinkedIn
    url: https://linkedin.com/in/username
    weight: 30
    params:
      icon: linkedin
  - name: Email
    url: mailto:your.email@example.com
    weight: 40
    params:
      icon: email