hugo建立个人博客

1、 安装Hugo

(1)二进制安装
到hugo的github上下载 https://github.com/gohugoio/hugo/releases
注:由于在github上下载太慢,百度云自取:(windows64位hugo压缩包) https://pan.baidu.com/s/1m_NVhDOOZo09974ugYdvcA 提取码: xqsm

2、 生成站点

hugo new site /path/to/site
这样就在 /path/to/site 目录里生成了初始站点,进去目录:
cd /path/to/site

3、 创建文章

hugo new about.md

about.md 自动生成导论content/about.md

4、 安装主题

在hugo官方文档挑选一款适合你的
然后:

cd themes
git clone xxxxx

5、配置

在你下载的主题文件里面,将exampleSite/theme.toml内容(有需求可自行修改下)复制到根目录下的config.toml中

6、 在本地运行hugo

hugo serve -t maupassant-hugo --buildDrafts//maupassant-hugo为你的theme名字

然后在浏览器输入http://localhost:1313
预览网站,按ctrl+c结束。

7、 部署到github上

(1)创建新库 名字格式为: 你的github用户名.github.io
注:名字格式必须这样,然后复制地址 如:https://github.com/defeat5839/defeat5839.github.io.git
(2) 部署

hugo --theme=maupassant-hugo --baseUrl="https://defeat5839.github.io/" --buildDrafts

hyde为你的主题名字,后面那个地址为上步骤复制的那个
(3)提交

cd public
git init
git add .
git commit -m "first"
git remote add origin https://github.com/defeat5839/defeat5839.github.io.git
git push//git push -u origin master

最后通过https://你的github名字.github.io访问

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值