• English
  • Configuration Reference

    This page documents every configuration option available in _config.modernduang.yml. Each section corresponds to a top-level key in the config file.


    favicon

    The site favicon path.

    favicon: /img/favicon.ico
    PropertyTypeDescription
    faviconstringPath to favicon file

    Navigation menu configuration. Each key is the menu label and the value is either a URL string or an object with extended options.

    menu:
      首页: /
      归档: /archives
      标签: /tags
      分类: /categories
      友链: /links
      GitHub:
        url: https://github.com/yourname
        external: true

    Simple Menu Item

    A key-value pair where the value is a URL string. Uses the built-in icon matching the key name.

    menu:
      首页: /

    Extended Menu Item

    An object with additional options:

    menu:
      GitHub:
        url: https://github.com/yourname
        icon: '<svg viewBox="0 0 24 24">...</svg>'  # Custom SVG icon (optional)
        external: true                                # Open in new tab (optional)

    A menu item with nested children:

    menu:
      项目:
        icon: '<svg>...</svg>'  # Optional parent icon
        children:
          项目A: /project-a
          项目B:
            url: https://external.com
            external: true

    Built-in Icons

    The following menu names have built-in SVG icons: 首页, 归档, 标签, 分类, 友链, 开往, 关于.

    For custom menu names, provide your own SVG via the icon property.

    PropertyTypeDefaultDescription
    urlstringThe link URL
    iconstringCustom SVG icon string
    externalbooleanfalseOpen link in new tab
    childrenobjectNested submenu items

    dark_mode

    Dark mode configuration.

    dark_mode:
      enable: true
      default: light
    PropertyTypeDefaultDescription
    enablebooleantrueEnable dark mode toggle
    defaultstring'light'Default color scheme ('light' | 'dark')

    font

    Google Fonts integration.

    font:
      enable: true
      host: https://fonts.googleapis.com
      global:
        external: true
        families:
          - Fredoka:wght@400;500;600;700
          - Nunito:wght@300;400;500;600
          - JetBrains+Mono:wght@400;500
    PropertyTypeDefaultDescription
    enablebooleantrueEnable Google Fonts loading
    hoststring'https://fonts.googleapis.com'Font CDN host (use a mirror if needed in China)
    global.externalbooleantrueLoad as external stylesheet
    global.familiesstring[]Google Font families to load

    comments

    Comment system configuration. Currently only supports Twikoo.

    comments:
      enable: false
      twikoo:
        envId: https://your-twikoo-envid
        region: ap-shanghai
    PropertyTypeDefaultDescription
    enablebooleanfalseGlobally enable the comment system
    twikoo.envIdstring''Your Twikoo environment ID (URL)
    twikoo.regionstring'ap-shanghai'Twikoo cloud region

    Tip: Set comment: false in a post's frontmatter to disable comments on that specific post.


    Footer configuration.

    footer:
      since: 2024
      author: YourName
      powered: true
      social:
        travelling: true
        github: true
        email: false
        custom: []
      custom: ''
      beian:
        icp: ''
        moe: ''
        chabei: ''
    PropertyTypeDefaultDescription
    sincenumberYear the site was established
    authorstring''Site author name
    poweredbooleantrueShow "Powered by Hexo & ModernDuang"
    PropertyTypeDefaultDescription
    social.travellingbooleantrueShow "开往" Travellings link
    social.githubbooleantrueShow GitHub icon (uses profile.social GitHub URL)
    social.emailbooleanfalseShow Email icon (uses profile.social Email URL)
    social.customarray[]Custom social icon items

    Each custom social item:

    social:
      custom:
        - name: RSS
          url: /atom.xml
          icon: rss                    # Built-in icon name or SVG string
          color: '#FF6600'             # Optional hover background color
    footer:
      custom: '<p>Your custom HTML content</p>'

    ICP Beian (Record Filing)

    footer:
      beian:
        icp: "京ICP备12345678号"    # Full MIIT beian number
        moe: "123456"                # Moe beian number (digits only)
        chabei: "123456"             # Chabei beian number (digits only)
    PropertyTypeDefaultDescription
    beian.icpstring''Full MIIT ICP beian number
    beian.moestring''Moe beian number (displays as "萌ICP备XXXXXX号", official: icp.gov.moe)
    beian.chabeistring''Chabei beian number (displays as "茶ICP备XXXXXX号", official: icp.redcha.cn)

    siteInfo

    Site information displayed on the friend links page.

    siteInfo:
      url: https://yourblog.com
      avatar: https://yourblog.com/avatar.png
      atom: https://yourblog.com/atom.xml
    PropertyTypeDefaultDescription
    urlstring''Your site URL
    avatarstring''Your site avatar/logo
    atomstring''Your Atom feed URL

    The site name and description are automatically inherited from Hexo's main _config.yml.


    hero

    Homepage hero section configuration.

    hero:
      mode: fixed
      text: 欢迎来到我的博客
      texts:
        - 欢迎来到我的博客
        - 用文字记录思考,用代码改变世界
    PropertyTypeDefaultDescription
    modestring'fixed'Display mode: 'fixed' or 'random'
    textstringTagline text (used in fixed mode)
    textsstring[]Pool of taglines (used in random mode)

    Fixed mode: Always displays the value of text.

    Random mode: Picks a random string from the texts array on each page load.


    plans

    Annual plans / goals displayed on the homepage.

    plans:
      - text: 完成自定义博客主题的开发
        done: true
        current: 1
        final: 1
      - text: 至少撰写10篇博客
        done: false
        current: 7
        final: 10
    PropertyTypeDefaultDescription
    textstringPlan/goal description
    donebooleanfalseWhether the plan is completed
    currentnumber0Current progress count
    finalnumber1Target count

    The homepage will display an overall progress bar and individual plan items. When done: true, the item shows a checkmark. When final > 1, a progress tag (current/final) is shown.


    profile

    Profile card displayed on the homepage.

    profile:
      avatar: https://your-avatar-url.png
      motto: Enjoy the moment
      social:
        - name: GitHub
          url: https://github.com/yourname
          icon: github
        - name: Bilibili
          url: https://space.bilibili.com/12345
          icon: bilibili
    PropertyTypeDefaultDescription
    avatarstring''Avatar image URL
    mottostring''Personal motto / tagline
    socialarray[]Social media links
    PropertyTypeDescription
    namestringDisplay name
    urlstringLink URL
    iconstringBuilt-in icon name or custom SVG string

    See the Social Icons page for the full list of built-in icon names.


    friendGroups

    Friend link categories/groups for the links page.

    friendGroups:
      技术伙伴: 🌟
      生活: 🎨
      朋友们: 🤝

    Each key is the group name and the value is an emoji icon.


    tags

    Tags page configuration.

    tags:
      icon: ''  # Custom SVG icon for the tags page header
    PropertyTypeDefaultDescription
    iconstring''Custom SVG icon for tags (empty = default # icon)

    categories

    Category page configuration. Define custom styling for specific categories.

    categories:
      技术:
        desc: 探索前沿技术
        icon: '<svg viewBox="0 0 24 24">...</svg>'
        color: 'var(--pastel-blue)'
        textColor: '#3A7CA5'
    PropertyTypeDefaultDescription
    descstringCategory description
    iconstringCustom SVG icon
    colorstringBackground color (CSS value)
    textColorstringIcon text color

    Unmatched categories will use default styling with auto-rotating colors.


    friends

    Friend links list.

    friends:
      - name: 示例博客
        url: https://example.com
        desc: 一个很棒的博客
        avatar: https://example.com/avatar.png
        group: 技术伙伴
    PropertyTypeDescription
    namestringFriend's site name
    urlstringFriend's site URL
    descstringShort description
    avatarstringAvatar image URL
    groupstringGroup name (must match a key in friendGroups)

    siteStats

    Site statistics displayed on the homepage.

    siteStats:
      enable: false
      startDate: '2024-01-01'
    PropertyTypeDefaultDescription
    enablebooleanfalseWhether to show the site stats widget on homepage
    startDatestring'2024-01-01'Site launch date (YYYY-MM-DD)

    The homepage shows:

    • Uptime — years and days since startDate
    • Ten-Year Countdown — automatically computed as startDate + 10 years, showing remaining percentage

    Full Example Configuration

    Here's a complete example showing all options:

    favicon: /img/favicon.ico
    
    menu:
      首页: /
      归档: /archives
      标签: /tags
      分类: /categories
      友链: /links
      开往:
        url: https://www.travellings.cn/go.html
        external: true
      关于: /about
    
    dark_mode:
      enable: true
      default: light
    
    font:
      enable: true
      host: https://fonts.googleapis.com
      global:
        external: true
        families:
          - Fredoka:wght@400;500;600;700
          - Nunito:wght@300;400;500;600
          - JetBrains+Mono:wght@400;500
    
    comments:
      enable: false
      twikoo:
        envId: ''
        region: ap-shanghai
    
    footer:
      since: 2024
      author: ''
      powered: true
      social:
        travelling: true
        github: true
        email: false
        custom: []
      custom: ''
      beian:
        icp: ''
        moe: ''
        chabei: ''
    
    siteInfo:
      url: ''
      avatar: ''
      atom: ''
    
    hero:
      mode: fixed
      text: 欢迎来到我的博客
      texts:
        - 欢迎来到我的博客
        - 用文字记录思考
    
    plans: []
    
    profile:
      avatar: ''
      motto: ''
      social: []
    
    friendGroups:
      朋友们: 👋
    
    tags:
      icon: ''
    
    categories: {}
    
    friends: []
    
    siteStats:
      enable: false
      startDate: '2024-01-01'