hugo mod

hugo mod

管理模組

說明

提供多種工具來協助管理專案中的模組依賴關係圖。 大多數操作需要系統中安裝 Go(版本 >= 1.12)和相關的版本控制系統(通常為 Git)。 如果僅在 /themes 資料夾內操作模組,或已透過 hugo mod vendor 進行封裝,則無需此環境。

Hugo 在處理模組時,會依以下順序解析站點配置中定義的組件:

  1. _vendor 資料夾(除非指定 --ignoreVendorPaths 標誌)
  2. Go Modules
  3. 主題資料夾內的資料

更多資訊請參閱 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)
      --quiet                      安靜模式建置
  -M, --renderToMemory             渲染到記憶體(主要用於執行伺服器時)
  -s, --source string              讀取檔案的相對檔案系統路徑
      --themesDir string           主題目錄的檔案系統路徑

相關內容