hugo new content
创建新内容
为您的网站创建新内容
概述
创建一个新的内容文件并自动设置日期和标题。 根据提供的路径,它会猜测要创建的文件类型。
您也可以使用 -k KIND 指定文件类型。
如果您的主题或网站中提供了原型,它们将被使用。
请确保在网站的根目录中运行此命令。
hugo new content [路径] [标识]
选项
  -b, --baseURL string      主机名(和路径)到根目录,例如 https://spf13.com/
      --cacheDir string     缓存目录的文件系统路径
  -c, --contentDir string   内容目录的文件系统路径
      --editor string       使用指定的编辑器编辑新内容(如果提供)
  -f, --force               如果文件已经存在,则覆盖文件
  -h, --help                帮助内容
  -k, --kind string         要创建的内容类型
  -t, --theme strings       要使用的主题(位于 /themes/主题名称/ 目录下)
从父命令继承的选项
      --clock string               设置 Hugo 使用的时钟,例如 --clock 2021-11-06T22:30:00.00+09:00
      --config string              配置文件(默认为 hugo.yaml|json|toml)
      --configDir string           配置目录(默认为 "config")
      --debug                      调试输出
  -d, --destination string         文件写入的文件系统路径
  -e, --environment string         构建环境
      --ignoreVendorPaths string   忽略与给定的 Glob 模式匹配的模块路径下的任何 _vendor 目录
      --logLevel string            日志级别(debug|info|warn|error)
      --quiet                      安静模式下进行构建
  -s, --source string              从文件系统路径中读取文件的相对路径
      --themesDir string           主题目录的文件系统路径
  -v, --verbose                    详细输出
另请参阅
- hugo new - 为您的网站创建新内容