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 要渲染的命名片段(在 segments 配置中配置)
-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)
--quiet 在静默模式下构建
-M, --renderToMemory 渲染到内存(主要在运行服务器时有用)
-s, --source string 读取文件的相对文件系统路径
--themesDir string 主题目录的文件系统路径
另请参阅
- hugo mod - 管理模块