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/

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-17 12:08:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-17 12:08:01       101 阅读
  3. 在Django里面运行非项目文件

    2024-06-17 12:08:01       82 阅读
  4. Python语言-面向对象

    2024-06-17 12:08:01       91 阅读

热门阅读

  1. vue前端-静态资源下载小坑记录

    2024-06-17 12:08:01       35 阅读
  2. QComboBox使用详解(Qt)

    2024-06-17 12:08:01       31 阅读
  3. 小程序wx:if 和hidden的区别?

    2024-06-17 12:08:01       31 阅读
  4. R语言自定义vlookup函数

    2024-06-17 12:08:01       28 阅读
  5. Spark 面试题(六)

    2024-06-17 12:08:01       29 阅读
  6. Android 自定义SeekBar显示进度百分比

    2024-06-17 12:08:01       28 阅读
  7. 图片Base64编码

    2024-06-17 12:08:01       36 阅读
  8. ElasticSearch(ES)

    2024-06-17 12:08:01       28 阅读