Skip to content

Menu

The menus in Aurora theme can be highly customized in the theme _config.aurora.yml file.

Default Menus

Aurora is packed with three styled pages, about page, tags page and archives page.

Home page and About page are enabled by default, where tags page and archives page can be configured in the menu section of the theme config file.

yaml
menu:
  About: false
  Tags: true
  Archives: true
menu:
  About: false
  Tags: true
  Archives: true

You can also set any of the above to false to disable certain page you don't want.

Custom Menus

Other than the default pages packed with Aurora, we can also add in any pages or external links to our main menus.

For example, if we want to add a external link to your github project, you can do that by configuring your menu like this:

yaml
menu:
  Tags: true
  Archives: true
  # External link for a github repo
  Aurora:
    name: 'Aurora'
    path: 'https://github.com/Aurora/hexo-theme-Aurora'
menu:
  Tags: true
  Archives: true
  # External link for a github repo
  Aurora:
    name: 'Aurora'
    path: 'https://github.com/Aurora/hexo-theme-Aurora'

Since v1.4.3, external link also supports mailto links. Which will bring your user to their email page for sending out an email.

yaml
menu:
  Tags: true
  Archives: true
  # External link for a github repo
  Email:
    name: 'Mail Me'
    path: 'mailto:[email protected]'
menu:
  Tags: true
  Archives: true
  # External link for a github repo
  Email:
    name: 'Mail Me'
    path: 'mailto:[email protected]'

Sometime you would want to group a set of links into a sub-menu. The good news is Aurora also support nested links. To create a nested link, all we have to do is add in a children property to the menu.

For example we want to have a projects menu, which include all the projects links as sub-menu links. This is how you would configure it:

yaml
menu:
  Tags: true
  Archives: true
  # Nested projects menu
  projects:
    name: 'Projects'
    children:
      obsidian:
        name: 'Obsidian Theme'
        path: 'https://github.com/tridiamond/hexo-theme-obsidian'
      Aurora:
        name: 'Aurora Theme'
        path: 'https://github.com/Aurora/hexo-theme-Aurora'
menu:
  Tags: true
  Archives: true
  # Nested projects menu
  projects:
    name: 'Projects'
    children:
      obsidian:
        name: 'Obsidian Theme'
        path: 'https://github.com/tridiamond/hexo-theme-obsidian'
      Aurora:
        name: 'Aurora Theme'
        path: 'https://github.com/Aurora/hexo-theme-Aurora'

NOTE

The parent link of a nested link won't need a path property, because if it's clicked it will not activate a page jump.

Even if you set a path for the parent link, the path link will be ignored.

TIP

Internal links can be added with a custom page. Please refer to the Page section of the document for usage details.

Multi-language Menu

Since the theme has I18n multi-language support, therefore the menu name also support multi-language setup. So far the theme support English and Chinese translations for the menu. (Will support more in the near future.)

To setup multi-language for the menu, all we have to do is configure the i18n property.

This property has 2 options:

  • zh-CN - for Simplify Chinese
  • zh-TW - for Traditional Chinese
  • en - for English

Setup Custom Multi-language name for default menus

Default menus like Tags, Archives, About and Links pages, we can also config them so they support custom multi-languages.

Here is an example for setting up an i18n config for the Tags page.

yaml
menu:
  Tags:
    i18n:
      en: My Tags
      zh-CN: 我的标签
  Archives: true
menu:
  Tags:
    i18n:
      en: My Tags
      zh-CN: 我的标签
  Archives: true

Multi-language for custom pages

For example you want to add a menu call contact, this is how to want to configure it.

yaml
menu:
  Tags: true
  Archives: true
  # Multi-language Contact menu
  contact:
    name: 'Contact'
    i18n:
      zh-CN: '联系我'
      en: 'Contact'
    path: 'http://domain.com/contact'
menu:
  Tags: true
  Archives: true
  # Multi-language Contact menu
  contact:
    name: 'Contact'
    i18n:
      zh-CN: '联系我'
      en: 'Contact'
    path: 'http://domain.com/contact'

Released under the MIT License.