hugo
hugo
构建站点
简介
hugo 是主命令,用于构建你的 Hugo 站点。
Hugo 是一个快速且灵活的静态站点生成器, 是由 spf13 和众多贡献者使用 Go 编程语言开发的。
Complete documentation is available at https://gohugo.io/.
hugo [flags]参数
-b, --baseURL string 指向根目录的域名(和路径),例如: https://spf13.com/
-D, --buildDrafts 构建时包含标记为 draft(草稿) 的内容
-E, --buildExpired 构建时包含过期的内容
-F, --buildFuture 构建时包含发布日期为将来时间的内容
--cacheDir string 缓存目录的路径
--cleanDestinationDir 除存在于 static 目录但不存在于目标目录中的文件
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
--config string config file (default is hugo.yaml|json|toml)
--configDir string config dir (default "config")
-c, --contentDir string filesystem path to content directory
-d, --destination string filesystem path to write files to
--disableKinds strings disable different kind of pages (home, RSS etc.)
--enableGitInfo add Git revision, date, author, and CODEOWNERS info to the pages
-e, --environment string build environment
--forceSyncStatic copy all files when static is changed.
--gc enable to run some cleanup tasks (remove unused cache files) after the build
-h, --help help for hugo
--ignoreCache ignores the cache directory
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
-l, --layoutDir string 布局文件所在的路径
--logLevel string log level (debug|info|warn|error)
--minify 对任何能够支持的输出格式(HTML、XML 等)进行压缩
--noBuildLock don't create .hugo_build.lock file
--noChmod 不同步文件的权限属性
--noTimes 不同步文件的修改时间
--panicOnWarning panic on first WARNING log
--poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
--printI18nWarnings 列出缺失的翻译
--printMemoryUsage print memory usage to screen at intervals
--printPathWarnings print warnings on duplicate target paths etc.
--printUnusedTemplates print warnings on unused templates.
--quiet 以安静模式构建
--renderSegments strings named segments to render (configured in the segments config)
-M, --renderToMemory render to memory (mostly useful when running the server)
-s, --source string filesystem path to read files relative from
--templateMetrics display metrics about template executions
--templateMetricsHints calculate some improvement hints when combined with --templateMetrics
-t, --theme strings themes to use (located in /themes/THEMENAME/)
--themesDir string filesystem path to themes directory
--trace file write trace to file (not useful in general)
-w, --watch watch filesystem for changes and recreate as needed请参阅
- hugo build - Build your site
- hugo completion - Generate the autocompletion script for the specified shell
- hugo config - Display site configuration
- hugo convert - Convert front matter to another format
- hugo deploy - Deploy your site to a cloud provider
- hugo env - Display version and environment info
- hugo gen - Generate documentation and syntax highlighting styles
- hugo import - Import a site from another system
- hugo list - List content
- hugo mod - Manage modules
- hugo new - Create new content
- hugo server - Start the embedded web server
- hugo version - Display version
