HUGO
Menu
GitHub 87548 stars Mastodon

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/) - 創建新內容.