Hexo博客备份和插件更新

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

1
2
hexo cl; hexo s   
hexo cl; hexo g; hexo d

备份hexo博客到GitHub

1
2
3
4
5
6
7
8
9
10
11
12
13
create a new repository on the command line
git add .
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/xxx/5555.git
git push -u origin main
push an existing repository from the command line
git add .
git remote add origin https://github.com/xxx/5555.git
git branch -M main
git push -u origin main

更新hexo插件

1
2
3
npm update -g
npm-check
npm-check -u

为主页文章卡片添加擦亮动画效果

  1. 操作步骤
    1、新增css内容
    新建文件source/css/home.css或在已引入的css中新增以下内容
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#recent-posts > .recent-post-item:not(a)::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 200%;
background: linear-gradient(to right, transparent, white, transparent);
transform: translateX(-200%);
transition: transform 0.5s linear;
z-index: 1;
}
#recent-posts > .recent-post-item:not(a):hover::before {
transform: translateX(100%) skewX(-60deg);
}

2、引入内容
在_config.anzhiyu.yml主题配置文件下inject配置项中head处
引入home.css文件

1
2
3
inject:
head:
- <link rel="stylesheet" href="/css/home.css"> # 首页文章卡片擦亮效果

转自:https://blog.667408.xyz/p/Hexo3/