Github + Hexo 搭建个人博客
创建Github仓库
仓库名 = github用户名 + github.io
image image配置git
设置用户名和邮箱
git config --global user.name "xuyanpeng"
git config --global user.email "pp2677345028@gmail.com"
配置密钥
ssh-keygen -t rsa -C "pp2677345028@gmail.com"
image image image检测是否成功
ssh git@github.com
image安装Node.js
Hexo基于Node.js 下载安装包,注意安装Node.js会包含环境变量及npm的安装,安装后,检测Node.js是否安装成功,在命令行中输入 node -v :
image检测npm是否安装成功,在命令行中输入npm -v :
image安装Hexo
npm install -g hexo-cli
image初始化博客网站
hexo init xypBlogWebSite
cd xypBlogWebSite/
npm install
安装主题
git clone git@github.com:xuyanpeng/hexo-theme-cafe.git cafe
image安装插件
npm install hexo-server --save
npm install hexo-admin --save
npm install hexo-generator-archive --save
npm install hexo-generator-feed --save
npm install hexo-generator-search --save
npm install hexo-generator-tag --save
npm install hexo-deployer-git --save
npm install hexo-generator-sitemap --save
域名解析
设置二级域名
image imageWhat is Hexo?
Hexo is a fast, simple and powerful blog framework. You write posts in Markdownor other languages and Hexo generates static files with a beautiful theme in seconds.
Requirements
Installing Hexo is quite easy. However, you do need to have a couple of other things installed first:
- Node.js
- Git
Install Hexo
Once all the requirements are installed, you can install Hexo with npm:
imagenpm install -g hexo-cli
setup
First, we init our website directory by hexo. Second we enter into the directory and then run the command "npm install".
hexo init qxWebSite
cd qxWebSite/
npm install
image
image
image
image
image
install theme
imagenpm install hexo-server --save
npm install hexo-admin --save
npm install hexo-generator-archive --save
npm install hexo-generator-feed --save
npm install hexo-generator-search --save
npm install hexo-generator-tag --save
npm install hexo-deployer-git --save
npm install hexo-generator-sitemap --save