当前位置:   article > 正文

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

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

前提条件

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

下载hugo

https://github.com/gohugoio/hugo/releases/download/v0.127.0/hugo_extended_0.127.0_windows-amd64.zip
  • 1
  • 解压到任意目录,然后将目录添加到系统环境变量 如图 (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
  • 1

新建博客

  • 使用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
  • 1
  • 2
  • 3
  • 4

拷贝文件

拷贝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 .
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

启动预览

hugo server -D
  • 1

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/741555
推荐阅读
相关标签
  

闽ICP备14008679号