创建 生成站点
hugo new site name
name是工程文件夹名称
设置主题
下载主题
git clone url themes/themeName
url是主题github下载链接
themeName是主题的名字
新建文章
hugo new post/fileName.md
在post文件夹下新建一个名为fileName.md的文件
本地启动
hugo server -t themeName --buildDrafts
-t是主题参数 themeName是主题名字
部署github
- 生成public文件夹
hugo --theme=themeName --baseUrl="url" --buildDrafts
themeName是主题名字
url是仓库地址(https://…github.io/)
名称执行结束后会生成public文件夹,接下来将public文件夹的内容上传至仓库
- 上传至仓库(git操作)
cd public //切换到public文件夹
git init
git add .
git commit -m "说明文字"
git remote add origin https://github.com/用户名/仓库名
git push -u origin master