怎样建立属于你的个人博客(包含避坑指南)

怎样建立属于你的个人博客

在欣赏博客时配上纯音乐吧~

需求配置:
注:本文使用霞鹜文楷
声明:本文由@Shanziyi原创,转载/引用请标明出处! ©Shanziyi 2024
装有Git的Windows PC 一台(Windows 10+)
一个Github账号

准备工作:

首先,建立一个仓库,命名必须符合<用户名>.github.io形式,设为公开 接着,建立一个博客文件夹,如D:\blog

安装hugo

法一:使用winget

1
winget install Hugo.Hugo.Extended

法二:使用包管理器Chocolatey
安装Chocolatey:

1
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

或参见Chocolatey官网
安装hugo:

1
choco install hugo-extended

新建博客项目

1
hugo new site exampleblog # 可以替换成任意你想要的名字

结构如下图


项目结构图


接着,在此处右键,选择更多选项···

选择Git Bash hereOpen Git Bash here

接着,输入命令

1
2
git init #先输入这条
git submodule < 你想要的主题的仓库网址 > /themes/ < 你的主题名字 >

参考文献(按对本文做的贡献排名):
使用 Hugo + Github Pages 部署个人博客——ratmomo’s blog
Hugo Documentation
解决Hugo无法加载css文件——瞬间的博客
Chocolatey - Software Management for Windows


许可协议及署名:
本文采用CC BY-NC-SA 4.0协议进行署名——Shanziyi
©Shanziyi 2024

总访问量:
Licensed under CC BY-NC-SA 4.0
使用 Hugo 构建
主题 StackJimmy 设计