日常更新文章
日常更新文章
1.新建一篇文章
在网站根目录:D:\Hugo\Sites\www.mdrink.cn
运行代码:hugo new post/**.md
2.在目录 D:\Hugo\Sites\www.mdrink.cn\content\post 下找到对应文件进行修改
3.本地预览, http://localhost:1313/
运行代码:hugo server -D
4.构建 Hugo 网站 运行代码:hugo
5.切换到目录 D:\Hugo\Sites\www.mdrink.cn\public ,提交修改至本地库
更新推送
推送准备,先运行代码:git pull origin master
git config --global http.sslverify "false"
git add -A
git commit -m 'commit info'
6.将修改推至远程库
git push -u origin master
添加图片
Hugo 的配置文件和文章中引用图片都是从static作为根目录的。(H:\HugoWebsite\blog\static)
也就是说首先要将图片放置到 static 文件夹下,以 static 为相对路径,然后进行引用,方式为:![](/pic_name.png)
,当然这样该 .md 文件中是不会显示,本地预览和部署后是可以看到的
正常做法:
写文章时,在该文章目录下新建文件夹存放照片,引用时采用相对路径。