安装Hugo(Go语言实现的一个博客生成器)
- 下载Hugo安装包(hugo_0.69.0_Windows-64bit.zip),下载地址
- 解压缩之后,将hugo.exe放入C:\Software\hugo中
- 将C:\Software\hugo路径加入环境变量PATH中
- 使用命令行hugo version查看是否安装成功
搭建博客,使用Github创建一个个人博客
- 进入hugo博客搭建指南
- 新建一个目录(HugoBlog),在此目录中运行hugo博客搭建指南中的step2-step7,代码如下
hugo new site unizhoulu.github.io-creator
cd unizhoulu.github.io-creator
git init
git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
echo 'theme = "ananke"' >> config.toml
hugo new posts/my-first-post.md
hugo server -D
code config.toml
hugo
- 在目录“unizhoulu.github.io-creator”下,新建文件.gitignore,将“public”写入其中
- 进入public,执行以下命令行
git init
git add .
git commit -v
- 在Github上新建一个repo,名字必须为“unizhoulu.github.io”
- 在public目录中运行以下命令行
git remote add origin git@github.com:unizhoulu/unizhoulu.github.io.git
git push -u origin master
- 个人博客创建成功,地址是:unizhoulu.github.io/
- 可以购买域名并配置个性化的博客地址