1、git命令

1、提交三件套

1
2
3
4
5

git add .
git commit -m "update"
git push origin main

2、从远程克隆仓库

1
2
3
4
5
6
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin 地址
git push -u origin main

3、查看远程仓库

1
git remote -v

2、hexo

1、创建文章

1
2
hexo new post "文章标题"
#会存放在source/_posts/文章标题.md

2、创建页面

1
2
hexo new page "页面名称"
会存放在source/页面名称/index.md

3、执行

1
hexo clean && hexo s

4、文件初始化

1
2
3
4
5
6
7
8
9
10
11
12
13
---
title: 学习笔记
date: 2026-08-26 12:00:00
updated: 2026-08-26 12:00:00
categories:
- 编程
tags:
- 深度学习
- DeepLearning
swiper_index: 2
cover: /img/p2.jpg
description: Hexo 博客配置教程
---

3、图片样式

1、普通图片用.WebP格式

1
2
3
4
5
6
7
npm install -g aywebp #通过aywebp插件实现批量转换

# 转换文件夹内所有图片(不包含子文件夹),并删除原始文件
aywebp ./文件夹名称 --delete-source

# 包含子文件夹,并设置质量为 90
aywebp ./文件夹名称 -r -q 90

2、Logo、图标等需要透明背景的图片:首选 SVG

1
2
3
npm install -g images-to-svg #通过images-to-svg插件实现转换 仅处理轻量

images-to-svg convert ./assets/logo.png