hugo
hugo
建置您的網站
說明
hugo
是主要指令,用於建置您的 Hugo 網站。
Hugo 是由 spf13 和其他貢獻者以 Go 語言開發的快速且彈性的靜態網站生成器。
完整文件可參考 Hugo 官方網站。
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 日誌即中止
--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 - 建置網站
- hugo completion - 生成指定 Shell 的自動補全腳本
- hugo config - 顯示網站設定
- hugo convert - 轉換前置資料為其他格式
- hugo deploy - 將網站部署到雲端提供商
- hugo env - 顯示版本與環境資訊
- hugo gen - 生成文件與語法高亮樣式
- hugo import - 從其他系統匯入網站
- hugo list - 列出內容
- hugo mod - 管理模組
- hugo new - 建立新內容
- hugo server - 啟動內嵌的網頁伺服器
- hugo version - 顯示版本資訊