个人网站/博客搭建教程

运营维护常用命令

添加相册集

1
hexo new page 2025Yearbook

更改设置

1
2
3
4
5
6
7
---
title: 2025年度合集
date: 2022-10-23 15:57:51
aside: false
top_img: false
type: "album_detail"
---

PicSizer文档 - DearXuan的主页

Jpg-C 图像批量修整压缩剪裁调整大小工具

PicSizer v4.9.3批量图片压缩软件,支持精确控制KB MB - 吾爱破解 - 52pojie.cn

【11.8更新】图片批量无损压缩 VIKY 3.4 - 吾爱破解 - 52pojie.cn

个人网站/博客搭建教程

blog_AuroraEve3.0

之前以及部署好环境了

直接

1
2
3
hexo init blog_AuroraEve3
cd blog_AuroraEve3
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu

打开 Hexo 根目录下的 config.yml, 找到以下配置项,把主题改为anzhiyu

1
2
3
4
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: anzhiyu #landscape

安装 pug 和 stylus 渲染插件

1
npm install hexo-renderer-pug hexo-renderer-stylus --save

windows 复制/themes/anzhiyu/_config.yml此文件到 hexo 根目录,并重命名为_config.anzhiyu.yml

以后如果修改任何主题配置,都只需修改 _config.anzhiyu.yml 的配置即可。

启动blog

1
hexo cl;hexo g;hexo s

最后更新于202503071050

标签页配置

1
hexo new page tags

你会找到 source/tags/index.md 这个文件

修改这个文件: 记得添加 type: "tags"

1
2
3
4
5
6
7
---
title: 标签
date: 2021-04-06 12:01:51
type: "tags"
comments: false
top_img: false
---

分类页配置

1
hexo new page categories

你会找到 source/categories/index.md 这个文件

修改这个文件: 记得添加 type: "categories"

1
2
3
4
5
6
7
---
title: 分类
date: 2022-02-23 17:56:00
aside: false
top_img: false
type: "categories"
---

内置阿里图标库:https://www.iconfont.cn/collections/detail?cid=44481

服务器选择

2025-云服务器专区 京东云 阿里云 腾讯云 配置最新价格表 与 官方活动地址.xlsx

部署到服务器
用宝塔面板把Hexo部署到服务器 | 小明的部落格

评论区搭建

【Vercel】Twikoo | 为你的HEXO加入评论系统 – 夜梦星尘の折腾日记

HEXO系列教程 | 在Butterfly主题中使用评论系统twikoo – 夜梦星尘の折腾日记

上传到GitHub

三步教你在将项目上传github_哔哩哔哩_bilibili

创建仓库

image-20250409132734013

参考如下代码

image-20250409132833301

1
2
3
4
5
6
git init
git add .
git commit -m "first commit"
git remote add origin https://github.com/AuroraEve927/AuroraEveBlog3.git
git branch -M master
git push -u origin master

image-20250409133816596

这样就成功部署了

遇到的问题

🧠 问题背景总结

你在 Hexo 博客项目中使用了一个主题目录 themes/anzhiyu,这个目录本身是一个 独立的 Git 仓库(即“嵌套仓库”或“子模块”),当你执行 git add . 时 Git 给出如下提示:

You’ve added another git repository inside your current repository…

这会导致以下问题:

  • Git 不会把 anzhiyu 目录里的所有文件真正加入主仓库;
  • 远程仓库无法正确识别或下载该主题内容;
  • 别人 git clone 后无法看到完整主题内容,必须另外处理子模块。

✅ 解决目标

不使用子模块链接,直接把 themes/anzhiyu 文件夹及其全部内容当作普通文件夹保存进仓库中。


🛠️ 解决步骤(适用于所有嵌套 Git 仓库目录)

✅ Step 1. 删除子仓库的 Git 跟踪信息
1
2
3
4
5
bash


复制编辑
rm -rf themes/anzhiyu/.git

这个 .git 是主题目录内部的 Git 仓库信息,我们需要删掉它才能让 Git 正确追踪其中文件。


✅ Step 2. 如果之前被当作子模块添加,先从 Git 缓存中移除它
1
2
3
4
5
bash


复制编辑
git rm --cached -r themes/anzhiyu

这一步把它从 Git 的索引中删除(不影响实际文件),避免 Git 继续当它是子模块。


✅ Step 3. 删除 .gitmodules 文件(如果存在)
1
2
bash复制编辑rm -f .gitmodules
rm -rf .git/modules/themes/anzhiyu

这些文件记录子模块信息,我们不需要了。


✅ Step 4. 重新添加整个主题目录为普通文件夹
1
2
bash复制编辑git add themes/anzhiyu
git commit -m "Add anzhiyu theme files into repository as regular folder"

✅ Step 5. 推送到远程仓库
1
2
3
4
5
bash


复制编辑
git push

🎁 最终效果

  • themes/anzhiyu 作为普通目录被完整纳入 Git 管理;
  • 不需要 git submodule 操作,别人一 git clone 就能直接用你的博客;
  • 不再出现 “warning: adding embedded git repository” 提示;
  • 更加易于部署、迁移、打包分享。