hugo build
hugo build
建置您的網站
說明
build
是主要指令,用於建置您的 Hugo 網站。
Hugo 是一個快速且靈活的靜態網站生成器,由 spf13 與其他貢獻者以 Go 語言打造,滿載熱情。
完整文件可參考:https://gohugo.io/
hugo build [flags]
選項
-b, --baseURL string 網站根目錄的主機名稱(與路徑),例如:https://spf13.com/
-D, --buildDrafts 包含被標記為草稿的內容
-E, --buildExpired 包含已過期的內容
-F, --buildFuture 包含具有未來發布日期的內容
--cacheDir string 快取目錄的檔案系統路徑
--cleanDestinationDir 移除在 static 目錄中未找到的目標檔案
--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 當 static 變更時同步所有檔案
--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 在首次警告時中止
--poll string 設定輪詢間隔,例如 --poll 700ms,使用基於輪詢的方式監視檔案系統變更
--printI18nWarnings 列出缺失的翻譯
--printMemoryUsage 間隔性地顯示記憶體使用狀況
--printPathWarnings 列出重複目標路徑的警告
--printUnusedTemplates 列出未使用的模板的警告
--quiet 安靜模式建置
--renderSegments strings 呈現已命名的區段(在 segments 配置中設定)
-M, --renderToMemory 渲染到記憶體(主要用於執行伺服器時)
-s, --source string 讀取檔案的相對檔案系統路徑
--templateMetrics 顯示模板執行的指標
--templateMetricsHints 結合 --templateMetrics 提供改進建議
-t, --theme strings 使用的主題(位於 /themes/THEMENAME/)
--themesDir string 主題目錄的檔案系統路徑
--trace file 將追蹤寫入檔案(一般情況下不使用)
-w, --watch 監視檔案系統變更並根據需要重新建置
相關內容
- hugo - 建置您的網站