title: Hexo小技巧
date: 2016/9/23 22:04:51
categories: 笔记
tags:
- Hexo
fancybox:
comments: true
permalink:
description:
---
## 部署时保证README.md不被渲染
在Hexo目录下的source根目录下添加一个,README.md。
修改Hexo目录下的_config.yml。
将skip_render参数的值设置上。skip_render: README.md
保存退出即可。
使用hexo d 命令就不会在渲染 README.md 这个文件了。
## 添加一个 SSH key
参考[Generating a new SSH key and adding it to the ssh-agent](https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/)
`ssh-keygen -t rsa -b 4096 -C "your_email@example.com"`
代码参数含义:
-t 指定密钥类型,默认是 rsa ,可以省略。-C 设置注释文字,比如邮箱。-f 指定密钥文件存储文件名。
以上代码省略了 -f 参数,因此,运行上面那条命令后会让你输入一个文件名,用于保存刚才生成的 SSH key 代码,如:
>Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]
当然,你也可以不输入文件名,使用默认文件名(推荐),那么就会生成 id_rsa 和 id_rsa.pub 两个秘钥文件。
接着又会提示你输入两次密码(该密码是你push文件的时候要输入的密码,而不是github管理者的密码)
当然,你也可以不输入密码,直接按回车。那么push的时候就不需要输入密码,直接提交到github上了,如:
>Enter passphrase (empty for no passphrase): # Enter same passphrase again:
接下来,就会显示如下代码提示,如:
>Your identification has been saved in /c/Users/you/.ssh/id_rsa.
Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
当你看到上面这段代码的时候,那就说明你的 SSH key 已经创建成功,你只需要添加到github的SSH key上就可以了。
登陆github系统。点击右上角的 Account Settings—->SSH Public keys —-> add another public keys
把你本地生成的密钥复制到里面(key文本框中), 点击 add key 就ok了
测试
可以输入下面的命令,看看设置是否成功,git@github.com的部分不要修改:
`ssh -T git@github.com`
## Gist
嵌入Gist片段
```
{% gist gist_id [filename] %}
```
{% gist dbfae0851767b54fe055acaad234a576 gistfile1.txt %}
或者直接粘贴Gitst生成的标签
```
```
后缀加上pibb就可以生成一个渲染好的页面
https://gist.github.com/tiimgreen/10545817.pibb