用Hexo免费搭建你自己的博客
Hexo基于node.js,可用于生成静态博客,结合github和Mac,可以专注创作了。
深入学习见文末引用。
hexo安装
brew install node
npm install hexo-cli -g #全局安装
创建博客
Hexo使用命令:
hexo init <folder> #执行init命令初始化hexo到你指定的目录
hexo new [layout] <title> #创建文章
hexo new page <title> #生成新页面
hexo generate #自动根据当前目录下文件,生成静态网页
-d #deploy after
-w #查看文件变化
hexo publish [layout] <filename> #发布草稿
hexo server #运行本地服务
-p #端口
-s #只生成静态文件
-l #生成log
--draft 连草稿也生成预览
hexo deploy
-g #generate before
hexo render <file1> [file2] ...
-o #output destination
hexo migrate <type> #Migrates content from other blog systems.
hexo clean #Cleans the cache file (db.json) and generated files (public).
hexo list <type> #Lists all routes.
hexo landscape-plus主题
git clone https://github.com/xiangming/landscape-plus.git themes/landscape-plus
#修改hexo的配置文件_config.yml
theme:landscape-plus
deploy
#使用git前先安装
npm install hexo-deployer-git --save
技巧
- 标签/分类的别名
在_config.yml里面配置
category_map:
工具集: tools
技术集: technique
tag_map:
Java: java
JavaScript: js
css: css
html5: html5
plugin
- rss
#安装
npm install hexo-migrator-rss --save
npm install hexo-generator-sitemap
npm install hexo-generator-feed --save
#根目录下_config.yml添加
# Extensions
plugins:
- hexo-generator-feed
- hexo-generator-sitemap
#Feed Atom
feed:
type: atom
path: atom.xml
limit: 20
#sitemap
sitemap:
path: sitemap.xml
hexo-html-minifier https://github.com/hexojs/hexo-html-minifier
HTML压缩插件 (!安装会无法generate,最后还是卸载此插件)
hexo-uglify https://github.com/hexojs/hexo-uglify
JavaScript压缩插件
hexo-clean-css https://github.com/hexojs/hexo-clean-css
css压缩插件
- duoshuo 评论
- baidu统计
vim themes\modernist\layout\_partial\baidu_tongji.ejs
#添加
<% if (theme.baidu_tongji){ %>
<script type="text/javascript">
#你的百度统计代码
</script>
<% } %>
#注册并登录百度统计获取你的统计代码。并设置关闭显示百度图标
vim themes\modernist\layout\_partial\head.ejs
#在『/head』之前增加:
<%- partial('baidu_tongji') %>
#重新生成并部署你的站点。
vim themes/landscape-plus/_config.yml
#menu下加
rss: /atom.xml
# Duoshuo
duoshuo_shortname: XXX
# Baidu tongji
baidu_tongji: true
- 不蒜子
- 相关推荐:无觅
- 站内搜索
- 百度
- swiftype
相比较而言,swiftype更个性化,但是搜索结果只是基于页面内容是否包含,没有百度智能。参考
- hexo-console-optimize:html+css+js优化
npm install hexo-console-optimize --save #安装
hexo o #优化,替代了 hexo g
参考自:
hexo-your-blog
深入学习,请看官方文档
本文链接 : http://blog.newbmiao.com/2015/06/16/hexo-on-your-github.html
用Hexo免费搭建你自己的博客的更多相关文章
- 使用Hexo+Github搭建属于自己的博客(进阶)
主题的配置:这里以NexT主题作为题材 1.安装NexT,在其文件夹中鼠标右键,点击Git Base Here.输入命令:git clone https://github.com/iissnan/he ...
- 使用Hexo+Github搭建属于自己的博客(基础)
前言 hexo是一个台湾人做的基于Node.js的静态博客程序,优势是生成静态文件的速度非常快,支持markdown, 我最终选定它的原因是它速度快而且不容易出错,并且可以一键部署到github或者其 ...
- 使用Hexo+Github搭建属于自己的博客
工具:Visual Studio Code/MarkdownPad技术:Hexo+Github 创建Github项目 Github账户注册和新建项目,项目必须要遵守格式:账户名.github.io,不 ...
- 使用Hexo & Github,搭建属于自己的博客
经过在网上各种找资料,踩过各种坑,终于搭建好了hexo,直接与gitbub一起使用,搭建起自己的免费的博客. 关于Hexo Hexo是一款基于Node.js的静态博客框架. Hexo特性 风一般的速度 ...
- 使用Github+Hexo框架搭建部署自己的博客
前言 Hexo 是一个快速.简洁且高效的博客框架.Hexo 使用 Markdown (或其他渲染引擎 )解析文章, 在几秒内,即可利用靓丽的主题生成静态网页. 安装 安装前提 安装 Hexo 相当简单 ...
- github+hexo+themes搭建简易个性主题博客
0x00 install Node.js and git 安装Node.js:http://www.runoob.com/nodejs/nodejs-install-setup.html 安装git ...
- HEXO+Github,搭建属于自己的博客
摘录自:http://www.jianshu.com/p/465830080ea9 1. github的准备 账号 密码 建立Repository建立与你用户名对应的仓库,仓库名必须为[your_us ...
- Hexo+Github 搭建属于自己的博客(Mac下安装 其他操作系统大同小异)
安装前提 参考博客:http://blog.csdn.net/gdutxiaoxu/article/details/53576018#t5(写的很好,不用看我的了.....) 这篇:http://ww ...
- 手把手教你使用Hexo+GitHub搭建自己的个人博客网站
安装nodejs环境 这个直接搜索安装即可,安装完成之后,通过如下命令检测环境变量是否安装成功: λ node -v # 输出版本号 v12.13.1 正确输入版本号即可. 安装cnpm cnpm是淘 ...
随机推荐
- Java全栈工程师知识体系介绍
Java全栈工程师,是指掌握多种技能,并能利用多种技能独立完成产品的人,也叫全端工程师(同时具备前端和后台能力),英文Full Stack developer. 那么想要成为一名合格的Java全栈工程 ...
- vuex实现购物车功能
购物车功能描述: 1. 点击+,-按钮,“已选:xx件”随之增减 2. checkbox选中时,当前项的已选数量增加到头部“已选择xx件”中,未选中时数量不计入 代码: 服务端 node+koa+ko ...
- PHP 数组序列化,转为字符串
serialize() <?php $a = array('a' => 'as' ,'b' => 'bs' , 'c' => 'cs'); //序列化数组 $s = seria ...
- 渲染路径-Deferred Lighting 延时光照
http://blog.csdn.net/heyuchang666/article/details/51564954 注意: 最后3个步骤注意下 延时光照是有着最高保真度的光照和阴影的渲染路径.如果你 ...
- vm安装mac
需要 vm虚拟机:vm10 mac系统: mac10.9 vm安装mac补丁 : unlokc-all-v120 vm tools for mac10.9: darwin6.0.3.iso ...
- Peptidomics analysis of milk protein-derived peptides
released over time in the preterm infant stomach
(文献分享一组-陈凌云)
题目:Peptidomics analysis of milk protein-derived peptides released over time in the preterm infant st ...
- Centos 7.x 安装 MongoDB
官方安装资料:点击直达 本次以Centos为安装主机 1:首先先导入MongoDB的yum源,因为Centos默认是没有MongoDB的yum源,创建文件:/etc/yum.repos.d/mongo ...
- E.华华给月月准备礼物
链接:https://ac.nowcoder.com/acm/contest/392/E 题意: 二月中旬虐狗节前夕,华华决定给月月准备一份礼物.为了搭建礼物的底座,华华需要若干根同样长的木棍.华华手 ...
- 牛客寒假6-C.项链
链接:https://ac.nowcoder.com/acm/contest/332/C 题意: 小B想给她的新项链染色. 现在有m种颜色,对于第i种颜色,小B有a_i单位的颜料,每单位颜料可以染项链 ...
- pycharm 虚拟环境virtualenv迁移到别的机器 无法读取包的问题
将virtualenv迁移到别的机器时,发现pycharm 总是无法读取目录下所在的包,后来经过实验终于找到了问题所在: 将自己所建的虚拟环境目录下的orig-prefix.txt中保存的路径,改成新 ...