设置¶
¥Setup¶
MkDocs 的 Material 提供了丰富的选项来定制您的文档。在本节中,我们将讲解如何为您的网站创建有意义的结构、更改外观、添加博客和评论系统,以及构建一个高度优化的网站。
¥Material for MkDocs offers a wide range of options for customizing your documentation. In this section, we will explain how you can create a meaningful structure for your site, change the look and feel, add a blog and comment system, and build a highly optimized site.
网站结构¶
¥Site structure¶
通过根据您的喜好配置页眉和页脚、在多种导航模式中进行选择、设置站点搜索等,设置和自定义文档结构。
¥Set up and customize the structure of your documentation by configuring the header and footer to your taste, choosing among many modes of navigation, setting up site search, and more.
外貌¶
¥Appearance¶
通过几行配置即可匹配您品牌的颜色、字体、图标、徽标等 - Material for MkDocs 可以轻松扩展基本配置或改变外观。
¥Match your brand's colors, fonts, icons, logo, and more with a few lines of configuration – Material for MkDocs makes it easy to extend the basic configuration or alter the appearance.
颜色– 使用现有调色板更改颜色或使用 CSS 自定义
字体– 从 1,000 种 Google 字体中选择或加载自托管字体
徽标和图标– 更改徽标,使用 8,000 多个图标中的任意一个,或添加新图标
社交卡片——分享链接时自动创建社交媒体预览
内容¶
¥Content¶
创建博客、集成评论系统、连接 git 存储库并设置与项目版本控制方法相匹配的版本化文档。
¥Create a blog, integrate a comment system, connect a git repository, and set up versioned documentation that matches your project's versioning methodology.
博客– 设置独立博客或将其与文档一起托管
¥Blog
评论系统——在任何页面或页脚添加第三方评论系统
版本控制——通过与外部实用程序集成来部署多个版本
存储库– 将您的文档连接到您的 git 存储库
优化¶
¥Optimization¶
添加站点分析并通过添加自动图像压缩、遵守 GDPR 数据隐私法规并使其具有离线功能来构建优化的站点。
¥Add site analytics and build an optimized site by adding automatic image compression, complying with GDPR data privacy regulations, and making it offline-capable.
网站分析– 了解用户如何体验您的文档
优化网站– 创建在搜索引擎上排名靠前的优化网站
数据隐私——确保遵守数据隐私法规
离线使用——构建可在线和离线使用的文档