Version main of the documentation is no longer actively maintained. The site that you are currently viewing is an archived snapshot. For up-to-date documentation, see the latest version.

基本站点配置

Docsy 站点的基本配置

​ 站点范围的配置细节和参数在项目的配置文件 (config.tomlhugo.toml) 中定义。这些包括你选择的 Hugo 主题(当然是 Docsy!)、项目名称、社区链接、Google Analytics 配置和 Markdown 解析器参数。在config.toml 的示例项目中查看带注释的示例,了解如何添加此信息。即使你只是使用主题而不是复制整个 Docsy 示例站点,我们建议复制此 config.toml 并进行编辑,因为它包括了许多参数的默认值,你需要设置这些参数才能正确构建站点。

​ 你可能想要立即删除或自定义复制的 config.toml 文件中的某些默认值:

国际化

​ 复制的 config.toml 文件定义了英语、挪威语和波斯语内容。你可以在 多语言支持 中了解 Docsy 如何支持多语言内容。

​ 如果你不打算翻译你的站点,可以通过从 config.toml 中删除以下行来删除语言切换器:

[languages.no]
languageName ="Norsk"
contentDir = "content/no"
[languages.no.params]
title = "Goldydocs"
description = "Docsy er operativsystem for skyen"
time_format_default = "02.01.2006"
time_format_blog = "02.01.2006"

[languages.fa]
languageName ="فارسی"
contentDir = "content/fa"
[languages.fa.params]
title = "اسناد گلدی"
description = "یک نمونه برای پوسته داکسی"
time_format_default = "2006.01.02"
time_format_blog = "2006.01.02"

搜索

​ 默认情况下,Docsy 示例站点使用自己的谷歌自定义搜索引擎。要禁用此站点搜索,请删除或注释以下行:

# Google Custom Search Engine ID. Remove or comment out to disable search.
gcs_engine_id = "011737558837375720776:fsdu1nryfng"

​ 要使用您自己的自定义搜索引擎,请将 gcs_engine_id 中的值替换为您自己搜索引擎的 ID。或选择其他搜索选项.

下一步是什么?

configuration file


最后修改 July 6, 2024: 修改中文文档 (ae42646)