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

前提条件

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

下载hugo

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

下载安装Git

bash 复制代码
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运行以下命令

shell 复制代码
hugo new site quickstart
cd quickstart
git init
git submodule add https://github.com/woniu336/hugo-magic.git themes/hugo-magic

拷贝文件

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

bash 复制代码
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/

相关推荐
James50624 天前
WordPress使用(1)
docker·博客·wordpress
java1234_小锋1 个月前
[免费]基于Python的Django博客系统【论文+源码+SQL脚本】
博客·python毕业设计·django毕业设计·python博客·django博客
云樱梦海2 个月前
Sonic:开源Go语言开发的高性能博客平台
开发语言·golang·开源·博客·sonic
ywang_wnlo2 个月前
【软件配置】使用 brew 安装特定版本软件
mac·brew·hugo
我叫czc2 个月前
【数字花园】个人知识库网站搭建:⑤本地构建+云服务器部署数字花园plus
笔记·博客·教程·网站搭建·数字花园·第二大脑·网站搭建教程
伊织code3 个月前
CSDN 博客自动发布脚本(Python 含自动登录、定时发布)
python·博客·登录·csdn·自动发布·定时
虞泽4 个月前
鸢尾博客项目开源
java·spring boot·vue·vue3·博客
明月登楼4 个月前
使用 CDN 后 Apache 的日志记录客户真实 IP
服务器·apache·博客·cdn·客户真实ip地址·独立博客
苹果醋35 个月前
毕业设计_基于SpringBoot+vue的社区博客系统【源码+SQL+教程+可运行】41002
java·毕业设计·博客
明明明h5 个月前
复制他人 CSDN 文章到自己的博客
博客·csdn