hugo
## hugo 构建您的站点 ### 简介 hugo 是主命令,用于构建您的 Hugo 站点。 Hugo 是一个快速且灵活的静态网站生成器 由 spf13 和朋友们用 Go 语言开发。 完整文档可在 https://www.hugodoc.com/ 获取。 ``` hugo [flags] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ -D, --buildDrafts 包含标记为草稿的内容 -E, --buildExpired 包含已过期的内容 -F, --buildFuture 包含发布日期在未来的内容 --cacheDir string 缓存目录的文件系统路径 --cleanDestinationDir 从目标目录中删除静态目录中找不到的文件 --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -c, --contentDir string 内容目录的文件系统路径 -d, --destination string 写入文件的文件系统路径 --disableKinds strings 禁用不同类型的页面(主页、RSS 等) --enableGitInfo 向页面添加 Git 修订版、日期、作者和 CODEOWNERS 信息 -e, --environment string 构建环境 --forceSyncStatic 静态文件更改时复制所有文件。 --gc 启用构建后运行一些清理任务(删除未使用的缓存文件) -h, --help hugo 的帮助 --ignoreCache 忽略缓存目录 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 -l, --layoutDir string 布局目录的文件系统路径 --logLevel string 日志级别(debug|info|warn|error) --minify 压缩任何支持的输出格式(HTML、XML 等) --noBuildLock 不创建 .hugo_build.lock 文件 --noChmod 不同步文件的权限模式 --noTimes 不同步文件的修改时间 --panicOnWarning 在第一个 WARNING 日志时 panic --poll string 设置轮询间隔,例如 --poll 700ms,使用基于轮询的方法监视文件系统更改 --printI18nWarnings 打印缺失的翻译 --printMemoryUsage 定期向屏幕打印内存使用情况 --printPathWarnings 打印重复目标路径等的警告 --printUnusedTemplates 打印未使用模板的警告 --quiet 以安静模式构建 --renderSegments strings 要渲染的命名段(在段配置中配置) -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --templateMetrics 显示模板执行的指标 --templateMetricsHints 与 --templateMetrics 结合使用时计算一些改进提示 -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) --themesDir string 主题目录的文件系统路径 --trace file 将跟踪写入文件(通常用处不大) -w, --watch 监视文件系统更改并根据需要重新创建 ``` ### 另请参阅 * [hugo build](/commands/hugo_build/) - 构建您的站点 * [hugo completion](/commands/hugo_completion/) - 为指定的 shell 生成自动完成脚本 * [hugo config](/commands/hugo_config/) - 显示站点配置 * [hugo convert](/commands/hugo_convert/) - 将 front matter 转换为另一种格式 * [hugo deploy](/commands/hugo_deploy/) - 将您的站点部署到云提供商 * [hugo env](/commands/hugo_env/) - 显示版本和环境信息 * [hugo gen](/commands/hugo_gen/) - 生成文档和语法高亮样式 * [hugo import](/commands/hugo_import/) - 从其他系统导入站点 * [hugo list](/commands/hugo_list/) - 列出内容 * [hugo mod](/commands/hugo_mod/) - 管理模块 * [hugo new](/commands/hugo_new/) - 创建新内容 * [hugo server](/commands/hugo_server/) - 启动嵌入式 Web 服务器 * [hugo version](/commands/hugo_version/) - 显示版本.
hugo build
## hugo build 构建您的站点 ### 简介 build 是主命令,用于构建您的 Hugo 站点。 Hugo 是一个快速且灵活的静态网站生成器 由 spf13 和朋友们用 Go 语言开发。 完整文档可在 https://www.hugodoc.com/ 获取。 ``` hugo build [flags] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ -D, --buildDrafts 包含标记为草稿的内容 -E, --buildExpired 包含已过期的内容 -F, --buildFuture 包含发布日期在未来的内容 --cacheDir string 缓存目录的文件系统路径 --cleanDestinationDir 从目标目录中删除静态目录中找不到的文件 --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -c, --contentDir string 内容目录的文件系统路径 -d, --destination string 写入文件的文件系统路径 --disableKinds strings 禁用不同类型的页面(主页、RSS 等) --enableGitInfo 向页面添加 Git 修订版、日期、作者和 CODEOWNERS 信息 -e, --environment string 构建环境 --forceSyncStatic 静态文件更改时复制所有文件。 --gc 启用构建后运行一些清理任务(删除未使用的缓存文件) -h, --help build 的帮助 --ignoreCache 忽略缓存目录 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 -l, --layoutDir string 布局目录的文件系统路径 --logLevel string 日志级别(debug|info|warn|error) --minify 压缩任何支持的输出格式(HTML、XML 等) --noBuildLock 不创建 .hugo_build.lock 文件 --noChmod 不同步文件的权限模式 --noTimes 不同步文件的修改时间 --panicOnWarning 在第一个 WARNING 日志时 panic --poll string 设置轮询间隔,例如 --poll 700ms,使用基于轮询的方法监视文件系统更改 --printI18nWarnings 打印缺失的翻译 --printMemoryUsage 定期向屏幕打印内存使用情况 --printPathWarnings 打印重复目标路径等的警告 --printUnusedTemplates 打印未使用模板的警告 --quiet 以安静模式构建 --renderSegments strings 要渲染的命名段(在段配置中配置) -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --templateMetrics 显示模板执行的指标 --templateMetricsHints 与 --templateMetrics 结合使用时计算一些改进提示 -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) --themesDir string 主题目录的文件系统路径 --trace file 将跟踪写入文件(通常用处不大) -w, --watch 监视文件系统更改并根据需要重新创建 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点.
hugo completion
## hugo completion 为指定的 shell 生成自动完成脚本 ### 简介 为指定的 shell 生成 hugo 的自动完成脚本。 有关如何使用生成的脚本的详细信息,请参阅每个子命令的帮助。 ### 选项 ``` -h, --help completion 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo completion bash](/commands/hugo_completion_bash/) - 为 bash 生成自动完成脚本 * [hugo completion fish](/commands/hugo_completion_fish/) - 为 fish 生成自动完成脚本 * [hugo completion powershell](/commands/hugo_completion_powershell/) - 为 powershell 生成自动完成脚本 * [hugo completion zsh](/commands/hugo_completion_zsh/) - 为 zsh 生成自动完成脚本.
hugo completion bash
## hugo completion bash 为 bash 生成自动完成脚本 ### 简介 为 bash shell 生成自动完成脚本。 此脚本依赖于 'bash-completion' 包。 如果尚未安装,可以通过操作系统的包管理器安装。 要在当前 shell 会话中加载自动完成: source <(hugo completion bash) 要为每个新会话加载自动完成,执行一次: #### Linux: hugo completion bash > /etc/bash_completion.d/hugo #### macOS: hugo completion bash > $(brew --prefix)/etc/bash_completion.d/hugo 您需要启动一个新的 shell 才能使此设置生效。 ``` hugo completion bash ``` ### 选项 ``` -h, --help bash 的帮助 --no-descriptions 禁用自动完成描述 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo completion](/commands/hugo_completion/) - 为指定的 shell 生成自动完成脚本.
hugo completion fish
## hugo completion fish 为 fish 生成自动完成脚本 ### 简介 为 fish shell 生成自动完成脚本。 要在当前 shell 会话中加载自动完成: hugo completion fish | source 要为每个新会话加载自动完成,执行一次: hugo completion fish > ~/.config/fish/completions/hugo.fish 您需要启动一个新的 shell 才能使此设置生效。 ``` hugo completion fish [flags] ``` ### 选项 ``` -h, --help fish 的帮助 --no-descriptions 禁用自动完成描述 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo completion](/commands/hugo_completion/) - 为指定的 shell 生成自动完成脚本.
hugo completion powershell
## hugo completion powershell 为 powershell 生成自动完成脚本 ### 简介 为 powershell 生成自动完成脚本。 要在当前 shell 会话中加载自动完成: hugo completion powershell | Out-String | Invoke-Expression 要为每个新会话加载自动完成,请将上述命令的输出 添加到您的 powershell 配置文件中。 ``` hugo completion powershell [flags] ``` ### 选项 ``` -h, --help powershell 的帮助 --no-descriptions 禁用自动完成描述 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo completion](/commands/hugo_completion/) - 为指定的 shell 生成自动完成脚本.
hugo completion zsh
## hugo completion zsh 为 zsh 生成自动完成脚本 ### 简介 为 zsh shell 生成自动完成脚本。 如果您的环境中尚未启用 shell 自动完成,您需要先启用它。可以执行以下命令一次: echo "autoload -U compinit; compinit" >> ~/.zshrc 要在当前 shell 会话中加载自动完成: source <(hugo completion zsh) 要为每个新会话加载自动完成,执行一次: #### Linux: hugo completion zsh > "${fpath[1]}/_hugo" #### macOS: hugo completion zsh > $(brew --prefix)/share/zsh/site-functions/_hugo 您需要启动一个新的 shell 才能使此设置生效。 ``` hugo completion zsh [flags] ``` ### 选项 ``` -h, --help zsh 的帮助 --no-descriptions 禁用自动完成描述 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo completion](/commands/hugo_completion/) - 为指定的 shell 生成自动完成脚本.
hugo config
## hugo config 显示站点配置 ### 简介 显示站点配置,包括默认设置和自定义设置。 ``` hugo config [command] [flags] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 --format string 首选文件格式(toml、yaml 或 json)(默认为 "toml") -h, --help config 的帮助 --lang string 要显示配置的语言。默认为定义的第一个语言。 --printZero 在输出中包含零值(例如 false、0、"")的配置选项 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo config mounts](/commands/hugo_config_mounts/) - 打印配置的文件挂载.
hugo config mounts
## hugo config mounts 打印配置的文件挂载 ``` hugo config mounts [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help mounts 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo config](/commands/hugo_config/) - 显示站点配置.
hugo convert
## hugo convert 将 front matter 转换为另一种格式 ### 简介 将 front matter 转换为另一种格式。 有关更多信息,请参阅 convert 的子命令 toJSON、toTOML 和 toYAML。 ### 选项 ``` -h, --help convert 的帮助 -o, --output string 写入文件的文件系统路径 --unsafe 启用不太安全的操作,请先备份 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo convert toJSON](/commands/hugo_convert_tojson/) - 将 front matter 转换为 JSON * [hugo convert toTOML](/commands/hugo_convert_totoml/) - 将 front matter 转换为 TOML * [hugo convert toYAML](/commands/hugo_convert_toyaml/) - 将 front matter 转换为 YAML.
hugo convert toJSON
## hugo convert toJSON 将 front matter 转换为 JSON ### 简介 toJSON 将内容目录中的所有 front matter 转换为使用 JSON 格式。 ``` hugo convert toJSON [flags] [args] ``` ### 选项 ``` -h, --help toJSON 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 -o, --output string 写入文件的文件系统路径 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 --unsafe 启用不太安全的操作,请先备份 ``` ### 另请参阅 * [hugo convert](/commands/hugo_convert/) - 将 front matter 转换为另一种格式.
hugo convert toTOML
## hugo convert toTOML 将 front matter 转换为 TOML ### 简介 toTOML 将内容目录中的所有 front matter 转换为使用 TOML 格式。 ``` hugo convert toTOML [flags] [args] ``` ### 选项 ``` -h, --help toTOML 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 -o, --output string 写入文件的文件系统路径 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 --unsafe 启用不太安全的操作,请先备份 ``` ### 另请参阅 * [hugo convert](/commands/hugo_convert/) - 将 front matter 转换为另一种格式.
hugo convert toYAML
## hugo convert toYAML 将 front matter 转换为 YAML ### 简介 toYAML 将内容目录中的所有 front matter 转换为使用 YAML 格式。 ``` hugo convert toYAML [flags] [args] ``` ### 选项 ``` -h, --help toYAML 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 -o, --output string 写入文件的文件系统路径 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 --unsafe 启用不太安全的操作,请先备份 ``` ### 另请参阅 * [hugo convert](/commands/hugo_convert/) - 将 front matter 转换为另一种格式.
hugo deploy
## hugo deploy 将您的站点部署到云提供商 ### 简介 将您的站点部署到云提供商 有关详细说明,请参阅 https://www.hugodoc.com/hosting-and-deployment/hugo-deploy/。 ``` hugo deploy [flags] [args] ``` ### 选项 ``` --confirm 在对目标进行更改之前请求确认 --dryRun 空运行 --force 强制上传所有文件 -h, --help deploy 的帮助 --invalidateCDN 使部署目标中列出的 CDN 缓存失效(默认为 true) --maxDeletes int 要删除的最大文件数,或 -1 禁用(默认为 256) --target string 配置文件中部署部分的部署目标;默认为第一个 --workers int 传输文件的工作线程数。默认为 10(默认为 10) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点.
hugo env
## hugo env 显示版本和环境信息 ### 简介 显示版本和环境信息。这对于 Hugo 错误报告很有用 ``` hugo env [flags] [args] ``` ### 选项 ``` -h, --help env 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点.
hugo gen
## hugo gen 生成文档和语法高亮样式 ### 简介 使用 Hugo 的文档引擎为您的项目生成文档,包括各种编程语言的语法高亮。 ### 选项 ``` -h, --help gen 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo gen chromastyles](/commands/hugo_gen_chromastyles/) - 为 Chroma 代码高亮器生成 CSS 样式表 * [hugo gen doc](/commands/hugo_gen_doc/) - 为 Hugo CLI 生成 Markdown 文档 * [hugo gen man](/commands/hugo_gen_man/) - 为 Hugo CLI 生成 man 页面.
hugo gen chromastyles
## hugo gen chromastyles 为 Chroma 代码高亮器生成 CSS 样式表 ### 简介 为给定的样式生成 Chroma 代码高亮器的 CSS 样式表。如果在配置中禁用了 markup.highlight.noClasses,则需要此样式表。 有关可用样式的预览,请参阅 https://xyproto.github.io/splash/docs/all.html ``` hugo gen chromastyles [flags] [args] ``` ### 选项 ``` -h, --help chromastyles 的帮助 --highlightStyle string 高亮行的前景和背景颜色,例如 --highlightStyle "#fff000 bg:#000fff" --lineNumbersInlineStyle string 内联行号的前景色和背景色,例如 --lineNumbersInlineStyle "#fff000 bg:#000fff" --lineNumbersTableStyle string 表格行号的前景色和背景色,例如 --lineNumbersTableStyle "#fff000 bg:#000fff" --omitClassComments 在生成的 CSS 中省略 CSS 类注释前缀 --omitEmpty 省略空的 CSS 规则(已弃用,不再需要) --style string 高亮器样式(请参阅 https://xyproto.github.io/splash/docs/)(默认为 "friendly") ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo gen](/commands/hugo_gen/) - 生成文档和语法高亮样式.
hugo gen doc
## hugo gen doc 为 Hugo CLI 生成 Markdown 文档 ### 简介 为 Hugo CLI 生成 Markdown 文档。 ``` hugo gen doc [flags] [args] ``` ### 选项 ``` -h, --help doc 的帮助 -o, --output string 目录,用于写入生成的文档(默认为 "./doc/") ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo gen](/commands/hugo_gen/) - 生成文档和语法高亮样式.
hugo gen man
## hugo gen man 为 Hugo CLI 生成 man 页面 ### 简介 为 Hugo CLI 生成 man 页面。 ``` hugo gen man [flags] [args] ``` ### 选项 ``` -h, --help man 的帮助 -o, --output string 目录,用于写入生成的 man 页面(默认为 "./man/") ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo gen](/commands/hugo_gen/) - 生成文档和语法高亮样式.
hugo import
## hugo import 从其他系统导入站点 ### 简介 从其他系统导入站点。 请参阅 import 的子命令以获取特定于平台的导入器。 ### 选项 ``` -h, --help import 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo import jekyll](/commands/hugo_import_jekyll/) - 从 Jekyll 导入.
hugo import jekyll
## hugo import jekyll 从 Jekyll 导入 ### 简介 从 Jekyll 导入。 ``` hugo import jekyll [flags] [args] ``` ### 选项 ``` -h, --help jekyll 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo import](/commands/hugo_import/) - 从其他系统导入站点.
hugo list
## hugo list 列出内容 ### 简介 列出内容。 请参阅 list 的子命令以获取各种列表选项。 ### 选项 ``` -h, --help list 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo list all](/commands/hugo_list_all/) - 列出所有内容 * [hugo list drafts](/commands/hugo_list_drafts/) - 列出草稿内容 * [hugo list expired](/commands/hugo_list_expired/) - 列出过期内容 * [hugo list future](/commands/hugo_list_future/) - 列出未来内容 * [hugo list published](/commands/hugo_list_published/) - 列出已发布内容.
hugo list all
## hugo list all 列出所有内容 ### 简介 列出所有内容,包括草稿、未来内容和过期内容。 ``` hugo list all [flags] [args] ``` ### 选项 ``` -h, --help all 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo list](/commands/hugo_list/) - 列出内容.
hugo list drafts
## hugo list drafts 列出草稿内容 ### 简介 列出草稿内容。 ``` hugo list drafts [flags] [args] ``` ### 选项 ``` -h, --help drafts 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo list](/commands/hugo_list/) - 列出内容.
hugo list expired
## hugo list expired 列出过期内容 ### 简介 列出已过期的内容。 ``` hugo list expired [flags] [args] ``` ### 选项 ``` -h, --help expired 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo list](/commands/hugo_list/) - 列出内容.
hugo list future
## hugo list future 列出未来内容 ### 简介 列出具有未来发布日期的内容。 ``` hugo list future [flags] [args] ``` ### 选项 ``` -h, --help future 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo list](/commands/hugo_list/) - 列出内容.
hugo list published
## hugo list published 列出已发布内容 ### 简介 列出非草稿、非未来和未过期的内容。 ``` hugo list published [flags] [args] ``` ### 选项 ``` -h, --help published 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo list](/commands/hugo_list/) - 列出内容.
hugo mod
## hugo mod 管理模块 ### 简介 各种帮助函数来帮助管理项目依赖图中的模块。 大多数操作需要在系统上安装 Go 版本(>= Go 1.12)和相关的 VCS 客户端(通常是 Git)。 如果您只操作 /themes 内的模块或通过 "hugo mod vendor" 将它们供应商化,则不需要这些。 请注意,Hugo 将始终首先解析站点配置中定义的组件,由 _vendor 目录提供(如果未提供 --ignoreVendorPaths 标志)、Go 模块或 themes 目录内的文件夹,按此顺序。 有关更多信息,请参阅 https://www.hugodoc.com/hugo-modules/。 ### 选项 ``` -h, --help mod 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/zh/commands/hugo/) - 构建您的站点 * [hugo mod clean](/zh/commands/hugo_mod_clean/) - 删除当前项目的 Hugo 模块缓存 * [hugo mod get](/zh/commands/hugo_mod_get/) - 解析当前 Hugo 项目中的依赖项 * [hugo mod graph](/zh/commands/hugo_mod_graph/) - 打印模块依赖图 * [hugo mod init](/zh/commands/hugo_mod_init/) - 将该项目初始化为 Hugo 模块 * [hugo mod npm](/zh/commands/hugo_mod_npm/) - 各种 npm 帮助函数 * [hugo mod tidy](/zh/commands/hugo_mod_tidy/) - 删除 go.mod 和 go.sum 中未使用的条目 * [hugo mod vendor](/zh/commands/hugo_mod_vendor/) - 将所有模块依赖供应商化到 _vendor 目录 * [hugo mod verify](/zh/commands/hugo_mod_verify/) - 验证依赖项.
hugo mod clean
## hugo mod clean 删除当前项目的 Hugo 模块缓存 ### 简介 删除当前项目的 Hugo 模块缓存。 ``` hugo mod clean [flags] [args] ``` ### 选项 ``` --all 清理整个模块缓存 -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help clean 的帮助 --pattern string 匹配要清理的模块路径的模式(如果未设置则为全部),例如 "**hugo*" --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod get
## hugo mod get 解析当前 Hugo 项目中的依赖项 ### 简介 解析当前 Hugo 项目中的依赖项。 一些示例: 安装给定模块的最新版本: hugo mod get github.com/gohugoio/testshortcodes 安装特定版本: hugo mod get github.com/gohugoio/testshortcodes@v0.3.0 安装所有直接模块依赖项的最新版本: hugo mod get hugo mod get ./...(递归) 安装所有模块依赖项(直接和间接)的最新版本: hugo mod get -u hugo mod get -u ./...(递归) 运行 "go help get" 以获取更多信息。"go get" 的所有标志在这里也适用。 请注意,Hugo 将始终首先解析站点配置中定义的组件,由 _vendor 目录提供(如果未提供 --ignoreVendorPaths 标志)、Go 模块或 themes 目录内的文件夹,按此顺序。 有关更多信息,请参阅 https://www.hugodoc.com/hugo-modules/。 ``` hugo mod get [flags] [args] ``` ### 选项 ``` -h, --help get 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod graph
## hugo mod graph 打印模块依赖图 ### 简介 打印带有模块状态信息(禁用、供应商化)的模块依赖图。 请注意,对于供应商化的模块,列出的是该版本而不是 go.mod 中的版本。 ``` hugo mod graph [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 --clean 删除验证失败的依赖项的模块缓存 -c, --contentDir string 内容目录的文件系统路径 -h, --help graph 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod init
## hugo mod init 将该项目初始化为 Hugo 模块 ### 简介 将该项目初始化为 Hugo 模块。 它将尝试猜测模块路径,但您可以通过将其作为参数传递来帮助,例如: hugo mod init github.com/gohugoio/testshortcodes 请注意,Hugo 模块支持多模块项目,因此您可以在 GitHub 上的子文件夹中初始化 Hugo 模块,作为一个示例。 ``` hugo mod init [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help init 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod npm
## hugo mod npm 各种 npm 帮助函数 ### 简介 各种 npm(Node 包管理器)帮助函数。 ``` hugo mod npm [command] [flags] ``` ### 选项 ``` -h, --help npm 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块 * [hugo mod npm pack](/zh/commands/hugo_mod_npm_pack/) - 实验性:为您的项目准备和写入复合 package.json 文件.
hugo mod npm pack
## hugo mod npm pack 实验性:为您的项目准备和写入复合 package.json 文件 ### 简介 为您的项目准备和写入复合 package.json 文件。 首次运行时,它会在项目根目录中创建 "package.hugo.json"(如果尚不存在)。此文件将用作模板文件,带有基础依赖集。 此集将与依赖树中找到的所有 "package.hugo.json" 文件合并,选择最接近项目的版本。 此命令标记为"实验性"。我们认为这是一个好主意,所以它不太可能从 Hugo 中删除,但我们需要在"实际生活"中测试它以了解它的效果,所以这可能会/将在 Hugo 的未来版本中更改。 ``` hugo mod npm pack [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help pack 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod npm](/zh/commands/hugo_mod_npm/) - 各种 npm 帮助函数.
hugo mod tidy
## hugo mod tidy 删除 go.mod 和 go.sum 中未使用的条目 ``` hugo mod tidy [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help tidy 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod vendor
## hugo mod vendor 将所有模块依赖供应商化到 _vendor 目录 ### 简介 将所有模块依赖供应商化到 _vendor 目录。 如果模块被供应商化,Hugo 将在那里查找其依赖项。 ``` hugo mod vendor [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 -h, --help vendor 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo mod verify
## hugo mod verify 验证依赖项 ### 简介 验证检查当前模块的依赖项(存储在本地下载的源代码缓存中)自下载以来是否未被修改。 ``` hugo mod verify [flags] [args] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 --clean 删除验证失败的依赖项的模块缓存 -c, --contentDir string 内容目录的文件系统路径 -h, --help verify 的帮助 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo mod](/zh/commands/hugo_mod/) - 管理模块.
hugo new
## hugo new 创建新内容 ### 简介 创建新内容文件并自动设置日期和标题。 它将根据提供的路径猜测要创建的文件类型。 您也可以使用 `-k KIND` 指定类型。 如果您的主题或站点中提供了原型,它们将被使用。 确保您在站点的根目录内运行此命令。 ### 选项 ``` -h, --help new 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo](/commands/hugo/) - 构建您的站点 * [hugo new content](/commands/hugo_new_content/) - 创建新内容 * [hugo new site](/commands/hugo_new_site/) - 创建新站点 * [hugo new theme](/commands/hugo_new_theme/) - 创建新主题.
hugo new content
## hugo new content 创建新内容 ### 简介 创建新内容文件并自动设置日期和标题。 它将根据提供的路径猜测要创建的文件类型。 您也可以使用 `-k KIND` 指定类型。 如果您的主题或站点中提供了原型,它们将被使用。 确保您在站点的根目录内运行此命令。 ``` hugo new content [path] [flags] ``` ### 选项 ``` -b, --baseURL string 根目录的主机名(和路径),例如 https://spf13.com/ --cacheDir string 缓存目录的文件系统路径 -c, --contentDir string 内容目录的文件系统路径 --editor string 使用此编辑器编辑新内容(如果提供) -f, --force 如果文件已存在则覆盖 -h, --help content 的帮助 -k, --kind string 要创建的内容类型 --renderSegments strings 要渲染的命名段(在段配置中配置) -t, --theme strings 要使用的主题(位于 /themes/THEMENAME/) ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo new](/commands/hugo_new/) - 创建新内容.
hugo new site
## hugo new site 创建新站点 ### 简介 在指定路径创建新站点。 ``` hugo new site [path] [flags] ``` ### 选项 ``` -f, --force 在非空目录内初始化 --format string 首选文件格式(toml、yaml 或 json)(默认为 "toml") -h, --help site 的帮助 ``` ### 从父命令继承的选项 ``` --clock string 设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00 --config string 配置文件(默认为 hugo.yaml|json|toml) --configDir string 配置目录(默认为 "config") -d, --destination string 写入文件的文件系统路径 -e, --environment string 构建环境 --ignoreVendorPaths string 忽略与给定 Glob 模式匹配的任何 _vendor 模块路径 --logLevel string 日志级别(debug|info|warn|error) --noBuildLock 不创建 .hugo_build.lock 文件 --quiet 以安静模式构建 -M, --renderToMemory 渲染到内存(主要在运行服务器时有用) -s, --source string 读取文件的相对文件系统路径 --themesDir string 主题目录的文件系统路径 ``` ### 另请参阅 * [hugo new](/commands/hugo_new/) - 创建新内容.