个人网站常用命令

Markdown语法

初级

ctrl shift k 插入代码块

1
2
3
# 一级标题
## 二级标题
### 三级标题
1
2
3
4
5
6
7
8
9
#无序列表
*1
*2
*3

#有序列表
1. 1
2. 2
3. 3
1
2
3
4
5
6
7
列表可以嵌套,上一级和下一级之间敲三个空格即可。

* 一级无序列表内容

* 二级无序列表内容
* 二级无序列表内容
* 二级无序列表内容
1
2
3
4
5
6
#分割线
* * *
***
**********
- - -
_________________
1
2
3
4
5
6
7
> 这里是引用
**这是加粗** !ctrl+b
__这也是加粗__
*这是倾斜* !ctrl+i
_这也是倾斜_
***这是加粗倾斜***
~~这是加删除线~~
1
2
3
#换行 
段落之间换行,可直接回车 !enter
段落内想要换行则在上一句最后添加<br>如: 你好<br>再见 !!shift+enter

你好
再见

进阶

1
2
3
#给插入的链接加上名称
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.

效果如下: This is an example inline link.
This link has no title attribute.
注:如果想要在新页面中打开的话可以用html语言的a标签代替。
超链接名

个人网站常用命令

输入hexo new page "pagename",新建页面
输入hexo new post "article title",新建文章
编写完markdown文件后,文章写好之后,首先清除掉旧的数据:hexo clean
组合命令:hexo s -g 生成并本地预览
hexo d -g 生成并上传

Error

1.fatal: Could not read from remote repository.
原因:客户端与服务端未生成 ssh key or 客户端与服务端的ssh key不匹配
解决:重新生成一次ssh key,并配置好GitHub账户
1.1 生成新的ssh key

1
2
3
4
5
6
7
8
9
10
$ ssh-keygen -t rsa -C "zhangjinhuan954@163.com" 
!这里的邮箱地址,输入注册 Github 的邮箱地址
Generating public/private rsa key pair.
Enter file in which to save the key(/c/Users/zhangjh/.ssh/id_rsa):
!回车就好 之后会要求你设置密码
Enter passphrase (empty for no passphrase):<设置密码>
Enter same passphrase again:<再次输入密码>
!成功
Your identification has been saved in /c/Users/zhangjh/.ssh/id_rsa
Your public key has been saved in /c/Users/zhangjh/.ssh/id_rsa.pub

1.2 添加SSH Key到GitHub上
找到id_rsa.pub,复制全部文本内容到github
打开github主页,右上角点击头像选中setting,继续选中左边菜单栏的SSH and GPG keys
选择New SSH key,Title最好写(内容随便),Key部分将复制内容粘贴进去就好
点击Add SSH key
1.3 测试

1
2
3
$ ssh -T git@github.com
Enter passphrase for key '/c/Users/Yi/.ssh/id_rsa': <输入刚刚设置的密码>
看到“You’ve successfully authenticated…” <成功!>

2
Git问题:解决“ssh:connect to host github.com port 22: Connection timed out”_ssh: connect to host 10.0.0.140 port 22: operation_人行花坞的博客-CSDN博客