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/

相关推荐
远瞻。4 天前
【博客】前端新手如何创建自己的个人网站相册
前端·docker·博客·反向代理
怀川6 天前
开源 NamBlog:一个博客外壳下的体验编译器
docker·ai·.net·博客·ddd·graphql·mcp
-一杯为品-14 天前
【致关注者】个人博客网站上线(附技术栈)
博客
小小资源铺21 天前
Foxiz v2.7.0 – WordPress 报纸新闻和杂志博客出版网站主题
博客·网站模板·wordpress 主题·foxiz·杂志·新闻门户
小小资源铺21 天前
Vault – 多功能 Elementor WordPress 主题 v3.2.6
博客·vault·企业网站·wordpress 主题·线上商店
HIT_Weston23 天前
67、【Ubuntu】【Hugo】搭建私人博客(一)
前端·ubuntu·hugo
南知意-23 天前
从零搭建 Live2D 看板娘教程(自建API避墙版)
服务器·前端·vue.js·开源·博客·美化·看板娘
AwakeFantasy1 个月前
关于fluid打字机问题的解决记录
javascript·博客·hexo·fluid
梅花142 个月前
基于Django的博客系统
后端·python·django·毕业设计·博客·博客系统·毕设
知了一笑2 个月前
互联网十年,从博客到知识库
笔记·博客·知识库·自媒体