hugo-magic主题使用教程(一)

前提条件

  • 以下教程以windows10为例
  • 操作终端使用git bash
  • 魔法上网的前提下

下载hugo

https://github.com/gohugoio/hugo/releases/download/v0.127.0/hugo_extended_0.127.0_windows-amd64.zip
  • 解压到任意目录,然后将目录添加到系统环境变量 如图 (windows)
  • 打开cmd 输入 hugo version 验证是否设置正确

下载安装Git

https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe

新建博客

  • 使用Git bash终端,打开方式: 桌面右键 找到 Git Bash Here
  • 如果没有魔法上网,git submodule add这一步会拉取失败

在桌面右键打开Git bash运行以下命令

hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/woniu336/hugo-magic.git themes/hugo-magic

拷贝文件

拷贝hugo-magic主题核心文件到根目录 quickstart

cp -rf themes/hugo-magic/exampleSite/* .
rm hugo.toml
mkdir -p data/summary 
mkdir -p assets/img 
cp themes/hugo-magic/data/footer_links.json data/ 
cp themes/hugo-magic/data/summary/summary.json data/summary/
cp -r themes/hugo-magic/archetypes .
cp -r themes/hugo-magic/shell .
cp -r themes/hugo-magic/static .
cp themes/hugo-magic/.gitignore .

启动预览

hugo server -D

打开浏览器,输入地址: http://localhost:1313/

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值