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/

相关推荐
其实防守也摸鱼14 小时前
CSDN博客写什么?从0到1打造你的技术影响力
笔记·测试用例·博客·教程·ai写作·ai辅助·高质量
杨浦老苏2 天前
基于MongoDB Atlas的博客热榜
数据库·博客·blog·waline
bingo彬哥20 天前
AI新时代下的图床管理方案-Cloudflare图床+MCP+Skills方案指南
博客·ai工具
我的golang之路果然有问题3 个月前
使用 Hugo + GitHub Pages + PaperMod 主题 + Obsidian 搭建开发博客
golang·go·github·博客·个人开发·个人博客·hugo
HIT_Weston3 个月前
116、【Ubuntu】【Hugo】首页板块配置:Leaf Bundle
ubuntu·hugo
杨浦老苏3 个月前
将Waline从LeanCloud迁移到MongoDB
数据库·博客·blog·waline
REDcker3 个月前
RESTful API设计规范详解
服务器·后端·接口·api·restful·博客·后端开发
REDcker4 个月前
CSDN博客汇总(1-99篇)
博客
远瞻。4 个月前
【博客】前端新手如何创建自己的个人网站相册
前端·docker·博客·反向代理