约吗?自媒体人

Github + Hexo 搭建个人博客

2019-07-16  本文已影响26人  0b78ba6f9fc8

创建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

image

安装主题

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 image

What 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:

Install Hexo

Once all the requirements are installed, you can install Hexo with npm:

image
npm 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

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
上一篇 下一篇

猜你喜欢

热点阅读