• 简体中文
  • 页脚与备案

    ModernDuang 的页脚区域承载建站年份、作者信息、社交图标和 ICP 备案信息。所有配置在 _config.modernduang.ymlfooter 字段下完成。

    基本页脚信息

    页脚的基础信息包括建站年份、作者名称和 Powered 声明:

    footer:
      since: 2024
      author: 你的名字
      powered: true
    属性类型默认值描述
    sincenumber2024站点建立年份,若早于当前年份则显示为"年份-当前年份"范围
    authorstring''站点作者名称,留空则从 Hexo _config.ymlauthor 继承
    poweredbooleantrue是否显示"Powered by Hexo & ModernDuang"(或 Elegant)字样

    年份显示规则

    • since 与当前年份相同:显示 2024
    • since 早于当前年份:显示 2024 - 2026
    • since 晚于当前年份(通常为配置错误):仅显示当前年份

    页脚社交图标

    页脚可以独立于个人信息卡片显示一组社交图标:

    footer:
      social:
        travelling: true
        github: true
        email: false
        custom: []
    属性类型默认值描述
    social.travellingbooleantrue显示"开往"友链接力图标
    social.githubbooleantrue显示 GitHub 图标(使用 profile.social 中的 github 链接)
    social.emailbooleanfalse显示 Email 图标(使用 profile.social 中的 email 链接)
    social.customarray[]自定义社交图标项

    注意: githubemail 需要你在 profile.social 中配置了对应的条目才会显示。如果 profile.social 中没有 github 的条目,即使 footer.social.github: true 也不会显示图标。

    自定义社交图标项

    social.custom 数组中的每一项支持以下属性:

    footer:
      social:
        custom:
          - name: RSS
            url: /atom.xml
            icon: rss
            color: '#FF6600'
          - name: 知乎
            url: https://www.zhihu.com/people/yourname
            icon: '<svg viewBox="0 0 24 24">...</svg>'
            color: '#0066FF'
    属性类型必填描述
    namestring显示名称,hover 提示使用
    urlstring链接地址
    iconstring内置图标名或自定义 SVG 字符串
    colorstring悬停时的背景色(默认为主题强调色)

    自定义页脚 HTML

    custom 字段允许你在页脚 Render 之前注入任意 HTML 代码:

    footer:
      custom: '<div style="text-align:center; margin-top:10px;">托管于 <a href="https://vercel.com" target="_blank">Vercel</a></div>'

    常见用途:

    • 版权声明补充文案
    • 托管平台链接
    • 统计代码徽章
    • 自定义导航链接组

    注意: 自定义 HTML 会原样输出,请确保代码合法,避免引入 XSS 风险。

    ICP 备案

    ModernDuang 支持中国大陆常见的三种 ICP 备案格式:

    footer:
      beian:
        icp: ''
        moe: ''
        chabei: ''

    工信部备案(ICP)

    最标准的 ICP 备案格式,需要填写完整的备案号:

    footer:
      beian:
        icp: "京ICP备12345678号-1"

    页脚显示效果:

    © 2024 你的名字 | Powered by Hexo & ModernDuang
    京ICP备12345678号-1

    工信部备案号会以超链接形式链接至 https://beian.miit.gov.cn/

    萌备案(萌ICP备)

    面向二次元/个人站长的非官方趣味备案。只需填写数字部分:

    官方地址:https://icp.gov.moe/join.php

    footer:
      beian:
        moe: "123456"

    页脚显示效果:

    萌ICP备123456号

    茶备案(茶ICP备)

    另一种趣味备案,格式与萌备案类似。只需填写数字部分:

    官方地址:https://icp.redcha.cn/

    footer:
      beian:
        chabei: "789012"

    页脚显示效果:

    茶ICP备789012号

    提示: 三种备案可以同时使用,它们会按工信部 -> 萌 -> 茶的顺序排列显示。

    页脚布局

    页脚整体布局为两行式 flexbox 布局(移动端堆叠为单列):

    ┌──────────────────────────────────────────┐
    │  © 2024 你的名字 | Powered by Hexo & ModernDuang  │
    │  [社交图标]  [备案信息]  [自定义HTML]              │
    └──────────────────────────────────────────┘
    • 第一行:版权信息与 Powered 声明
    • 第二行:社交图标、备案信息和自定义 HTML
    • 移动端各元素垂直堆叠

    完整配置示例

    footer:
      since: 2024
      author: 张三
      powered: true
      social:
        travelling: true
        github: true
        email: true
        custom:
          - name: RSS
            url: /atom.xml
            icon: rss
            color: '#FF6600'
      custom: '<span style="font-size:12px;color:var(--text-muted)">托管于 Vercel</span>'
      beian:
        icp: "京ICP备12345678号-1"
        moe: "123456"
        chabei: "789012"

    相关页面