obsidian从零开始搭建hugo博客(一)环境安装

系列 - 利用obsidian从零开始搭建hugo博客

https://github.com/gohugoio/hugo/releases/tag/v0.120.4

为什么要配置环境变量?配置的原因是使得这个二进制文件可以在终端任意地方执行,如果你不配置环境变量,那么终端只能在软件所在目录下执行该程序。

下载完成hugo之后,解压,找到hugo.exe目录所在的位置,复制上面的路径,例如我把它解压到了 C:\Users\pcvmm\Desktop\software\mybin\hugo_extended_0.120.4_windows-amd64

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110113241.png

打开环境变量。此电脑右键->属性->高级系统设置->环境变量

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110112934.png
双击Path,新建,然后粘贴
/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110113453.png
依次确定,环境变量窗口也点确定并关闭
/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110113735.png

打开终端(如果已经打开终端,需要重启终端) 输入hugo version ,显示版本号则成功配置。

1
2
3
PS C:\Users\pcvmm> hugo version
hugo v0.120.4-f11bca5fec2ebb3a02727fb2a5cfb08da96fd9df+extended windows/amd64 BuildDate=2023-11-08T11:18:07Z VendorInfo=gohugoio
PS C:\Users\pcvmm>

https://git-scm.com/downloads

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110114437.png
默认配置就行
/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110114503.png

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110114551.png

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110114605.png
选项虽然非常多,全部默认选项一直点Next就可以,其实不用搞这么复杂的。安装好后,你会发现git自动帮我们添加了git.exe的环境变量。也就是说即便你不用安装包的方式安装,而是下载的便携版的压缩包,解压之后仍然能够通过自己添加环境变量方式安装git
/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110114850.png

重启终端输入git version ,x显示版本号则表明安装成功

1
2
PS C:\Users\pcvmm> git version
git version 2.42.0.windows.2

https://obsidian.md/download

下载好后,直接打开即可

/obsidian%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%E6%90%AD%E5%BB%BAhugo%E5%8D%9A%E5%AE%A2%E4%B8%80%E7%8E%AF%E5%A2%83%E5%AE%89%E8%A3%85/Pasted%20image%2020231110115654.png

官网下载后安装即可 https://code.visualstudio.com/docs/?dv=win64user

相关内容

hugo博客SEO优化
obsidian从零开始搭建hugo博客(二)快速建站
obsidian插件开发-链接的显示问题
obsidian插件开发-常用文件操作
用obsidian管理hugo文章小技巧