threst's Blog

艰难的hexo上线

2018/05/12 Share

我就是那个触发了这一切的错漏。
漏洞不仅仅是个错误,这还说明有更大的问题。思想上的纰漏,说明了你是个怎么样的人。
永远不给他们看我的源代码,只有这样才能保护我自己。封闭自己,创造出冰冷而完美的迷宫,没人能找到我。
从现在开始,过一种没有漏洞的生活,不惜一切地保护我的完美迷宫。
《Mr Robot》S01
《黑客军团》第1季

写在前面的话

之前一直想搭个博客记录一下学习,也算是监督,办域名弄空间太麻烦了,于是打算就是使用github+hexo搭个静态的.

kali下的尝试

在网上搜了下全是关于windows和mac下的,并没有linux下的,更别说kali,要搭hexo首先要以下条件:
1.nodejs
2.git
3.hexo
开始发现kali自带nodejs,大喜!但是喜不过三秒,npm命令找不到,各种尝试,个个失败:(
突然发现可以重装node,于是卸载node,然后又在弄npm和node的链接,
npm install -g cnpm --registry=https://registry.npm.taobao.org
npm install hexo-cli -g
cd /node-v4.9.1-linux-x64/lib/node_modules/hexo-cli/bin
./hexo -v终于有hexo了
hexo -init提示not empty, please run hexo init on an empty folder and then copy your files into it
sudo ln -s /home/threst/node-v4.9.1-linux-x64/lib/node_modules/hexo-cli/bin /hexo /usr/local/bin/hexo
mkdir hexo
cd hexo
hexo init
创建好了,可是使用npm install没有回显提示hexo
失败!!!!

win7尝试

因为去装了个移动硬盘原来那个kali系统不用了,所以要重新安装虚拟机,这里又是个坑,虚拟机各种报错,后来发现没有apt upgrade

正式安装

1.下载git,nodejs
2.github创建gitpage项目
3.npm install hexo -g
4.hexo -v检查是否安装成功
5.新建hexo文件夹,进入hexo init安装hexo
6.npm install
7.在hexo文件夹中右键,git bash
8.git config --global user.name "threst"
git config --global user.email "qq.com"
9.ssh-keygen -t rsa -C "qq.com"
10.在github中添加ssh key,输入id_rsa.pub
11.ssh -T git@github.com

The authenticity of host ‘github.com (13.250.177.223)’ can’t be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,13.250.177.223’ (RSA) to the list of known hosts.
Hi threst! You’ve successfully authenticated, but GitHub does not provide shell access.

ssh可以连接
这里又是个坑,hexo d的时候总是传不到github上去,只有本地有,问了些大佬,都没这种问题,后来发现
repo有两种方式,只有这种可以,之前试的是https://threst/threst.github.io.git
deploy:
type: git
repo: git@github.com:threst/threst.github.io.git
branch: master
13.
提示ERROR Deployer not found: git
npm install hexo-deployer-git --save
14.hexo clean
hexo g
hexo d
测试0k

安装主题

在hexo文件夹中打开gitbash
npm install hexo-generator-json-content --save && git clone https://github.com/fi3ework/hexo-theme-archer.git themes/archer
在_config.yml中设置theme: archer

最后的坑

1.主题中_config的图片不用加引号
2.favion我没有写所以在_config中把那行直接去掉,而不是不填
这两点都可导致页面打开404或空白
(重装5遍)

CATALOG
  1. 1. 写在前面的话
  2. 2. kali下的尝试
  3. 3. win7尝试
  4. 4. 正式安装
  5. 5. 安装主题
  6. 6. 最后的坑