Skip to content

设置页脚

¥Setting up the footer

项目文档的页脚非常适合添加您或您的公司用作其他营销渠道的网站或平台的链接,例如或者,您可以通过mkdocs.yml轻松配置。

¥The footer of your project documentation is a great place to add links to websites or platforms you or your company are using as additional marketing channels, e.g. or , which you can easily configure via mkdocs.yml.

配置

¥Configuration

¥Navigation

9.0.0

¥9.0.0

页脚可以包含当前页面的上一页和下一页的链接。如果您希望启用此功能,请在mkdocs.yml中添加以下几行:

¥The footer can include links to the previous and next page of the current page. If you wish to enable this behavior, add the following lines to mkdocs.yml:

theme:
  features:
    - navigation.footer

¥Social links

1.0.0

¥1.0.0

社交链接会呈现在版权声明旁边,作为项目文档页脚的一部分。在mkdocs.yml中添加以下社交链接列表:

¥Social links are rendered next to the copyright notice as part of the footer of your project documentation. Add a list of social links in mkdocs.yml with:

extra:
  social:
    - icon: fontawesome/brands/mastodon # (1)!
      link: https://fosstodon.org/@squidfunk
  1. 输入几个关键字,使用我们的图标搜索找到完美的图标,然后单击短代码将其复制到剪贴板:

每个链接均具有以下属性:

¥Enter a few keywords to find the perfect icon using our icon search and click on the shortcode to copy it to your clipboard:

icon

此属性必须包含与主题捆绑的任何图标的有效路径,否则构建将失败。一些常用的选项:

  • fontawesome/brands/github

    ¥fontawesome/brands/github

  • fontawesome/brands/gitlab

    ¥fontawesome/brands/gitlab

  • fontawesome/brands/x-twitter

    ¥fontawesome/brands/x-twitter

  • fontawesome/brands/mastodon自动添加rel=me

    ¥fontawesome/brands/mastodonautomatically adds rel=me

  • fontawesome/brands/docker

    ¥fontawesome/brands/docker

  • fontawesome/brands/facebook

    ¥fontawesome/brands/facebook

  • fontawesome/brands/instagram

    ¥fontawesome/brands/instagram

  • fontawesome/brands/linkedin

    ¥fontawesome/brands/linkedin

  • fontawesome/brands/slack

    ¥fontawesome/brands/slack

  • fontawesome/brands/discord

    ¥fontawesome/brands/discord

  • fontawesome/brands/pied-piper-alt

    ¥fontawesome/brands/pied-piper-alt

link

此属性必须设置为包含 URI 方案的相对或绝对 URL。支持所有 URI 方案,包括mailtobitcoin

extra:
  social:
    - icon: fontawesome/brands/mastodon
      link: https://fosstodon.org/@squidfunk
extra:
  social:
    - icon: fontawesome/solid/paper-plane
      link: mailto:<email-address>
name

链接中的域名(如果可用)此属性用作链接的title属性,可以设置为可辨别的名称以提高可访问性:

¥The following properties are available for each link:

extra:
  social:
    - icon: fontawesome/brands/mastodon
      link: https://fosstodon.org/@squidfunk
      name: squidfunk on Fosstodon

¥Copyright notice

0.1.0

¥ This property must contain a valid path to any icon bundled with the theme, or the build will not succeed. Some popular choices:

自定义版权横幅可以作为页脚的一部分呈现,显示在社交链接旁边。它可以定义为mkdocs.yml的一部分:

¥ This property must be set to a relative or absolute URL including the URI scheme. All URI schemes are supported, including mailto and bitcoin:

copyright: Copyright &copy; 2016 - 2020 Martin Donath

发电机通知

¥Generator notice

7.3.0真实

¥domain name from link, if available This property is used as the link's title attribute and can be set to a discernable name to improve accessibility:

页脚会显示一条“Made with Material for MkDocs”的通知,以说明网站的生成方式。您可以通过mkdocs.yml使用以下选项删除该通知:

¥0.1.0

extra:
  generator: false

删除发电机通知前请阅读此内容

¥A custom copyright banner can be rendered as part of the footer, which is displayed next to the social links. It can be defined as part of mkdocs.yml:

页脚处巧妙的“使用 Material for MkDocs 制作”提示是该项目如此受欢迎的原因之一,因为它告诉用户网站的生成方式,帮助新用户发现这个项目。在删除之前,请考虑您正在免费享受@squidfunk的成果,因为这个项目是开源的,并且拥有宽松的许可证。该项目投入了数千小时,其中大部分都没有任何经济回报。

¥7.3.0 true

因此,如果您删除此通知,请考虑赞助该项目。谢谢

¥The footer displays a Made with Material for MkDocs notice to denote how the site was generated. The notice can be removed with the following option via mkdocs.yml:

用法

¥Usage

¥Hiding prev/next links

可以使用 front matter hide属性隐藏显示上一页和下一页链接的页脚导航。在 Markdown 文件的顶部添加以下几行:

¥Please read this before removing the generator notice

---
hide:
  - footer
---

# Page title
...

定制

¥Customization

¥Custom copyright

8.0.0

¥The subtle Made with Material for MkDocs hint in the footer is one of the reasons why this project is so popular, as it tells the user how the site is generated, helping new users to discover this project. Before removing please consider that you're enjoying the benefits of @squidfunk's work for free, as this project is Open Source and has a permissive license. Thousands of hours went into this project, most of them without any financial return.

为了定制和覆盖版权声明扩展主题覆盖 copyright.html 部分,该部分通常包括在mkdocs.yml中设置的copyright属性。

¥Thus, if you remove this notice, please consider sponsoring the project. Thank you