Welcome to the best,the greatest WolfDeer’s blog!
Thanks: Codesheep
Learning Website: 手把手教你从0开始搭建自己的个人博客 |无坑版视频教程| hexo
Model Website: 闪烁之狐
Model Website: Redefine
博客装载:
用WIN自带的cmd软件,并打开管理员模式。
--- //安装Nodejs
node -v //查看node版本
npm -v //查看npm版本
npm install -g cnpm --registry=http://registry.npm.taobao.org //安装淘宝的cnpm 管理器
cnpm -v //查看cnpm版本
cnpm install -g hexo-cli //安装hexo框架
hexo -v //查看hexo版本
博客运行:
请使用 Git-bash 进入相应文件夹(blog)
基础操作
cd filename //进入文件夹
cd .. //返回
cd e //进入 e 盘
ls //显示当前文件夹
vim filename.后缀名 //编辑文件
Esc + ":wq" //保存并退出
Esc + ":q!" //直接退出(不保存)
Insert //切换模式(INSERT 或 REPLACE)
配置:
git config --global http.sslVerify false //修改网页设置
cnpm install --save hexo-deployer-git
mkdir blog
cd blog
hexo init //初始化,必须是空文件夹!
vim _config.yml : //修改配置
url: https://wolfdeer62456.github.io/project
root: https://wolfdeer62456.github.io/ //注意:hexo s时需要注释掉,否则会出错
deploy:
type: 'git'
repo: https://github.com/你的Github用户名/你的Git仓库名
branch: master
操作:
hexo n "filename" //新建博客
hexo s //本地模拟
hexo cl //清楚缓存
hexo g //装载
hexo d //上传
博客装载:
vim _config.yml : //修改配置
theme: #模板的名字
配件下载 :
网站加速(hexo-neat)
下载:
cnpm install hexo-neat --save
博客文件下的_config.yml配置:
neat_enable: true
//压缩html
neat_html:
enable: true
exclude:
//压缩css
neat_css:
enable: true
exclude:
//压缩js
neat_js:
enable: true
mangle: true
output:
compress:
exclude:
- '**/*.min.js'
- '**/jquery.fancybox.pack.js'
- '**/index.js'
文件压缩(hexo)
npm install hexo-html-minifier --save
npm install hexo-clean-css --save
npm install hexo-uglify --save
搜索
下载:
npm install hexo-generator-search --save
博客文件下的_config.yml配置:
search:
path: search.xml
field: post
将中文链接翻译成拼音
下载:
npm i hexo-permalink-pinyin --save
博客文件下的_config.yml配置:
permalink_pinyin:
enable: true
separator: '-' # default: '-'
帖子字数统计插件
下载:
npm i --save hexo-wordcount
博客文件下的_config.yml配置:
postInfo:
date: true
update: true
wordCount: true # set true.
totalCount: true # set true.
min2read: true # set true.
readCount: true # set true.
添加表情符号支持
下载:
npm install hexo-filter-github-emojis --save
博客文件下的_config.yml配置:
githubEmojis:
enable: true
className: github-emoji
inject: true
styles:
customEmojis: