hexo 皮肤Github
hexo 皮肤预览javascript
bashnpm install hexo -g #安装 npm update hexo -g #升级 hexo init #初始化
hexo n "个人博客"
== hexo new "个人博客"
#新建文章hexo p
== hexo publish
hexo g
== hexo generate
#生成hexo s
== hexo server
#启动服务预览hexo d
== hexo deploy
#部署html
hexo server
#Hexo 会监视文件变更并自动更新,您无须重启服务器。hexo server -s
#静态模式hexo server -p 5000
#更改端口hexo server -i 192.168.1.1
#自定义 IPjava
hexo clean
#清除缓存 网页正常状况下能够忽略此条命令hexo g
#生成静态网页hexo d
#开始部署git
hexo generate
#使用 Hexo 生成静态文件快速并且简单hexo generate --watch
#监视文件变更github
两个命令的做用是相同的
hexo generate --deploy
hexo deploy --generate
npm
hexo deploy -g
hexo server -g
xcode
hexo publish [layout] <title>
缓存
hexo new "postName"
#新建文章hexo new page "pageName"
#新建页面hexo generate
#生成静态页面至public目录hexo server
#开启预览访问端口(默认端口4000,'ctrl + c'关闭server)hexo deploy
#将.deploy目录部署到GitHubbash
hexo new [layout] <title>
hexo new photo "My Gallery"
hexo new "Hello World" --lang tw
服务器
变量 | 描述 |
---|---|
layout | 布局 |
title | 标题 |
date | 文件创建日期 |
title: 使用Hexo搭建我的博客 layout: post date: 2014-03-03 19:07:43 comments: true categories: Blog tags: [Hexo] keywords: Hexo, Blog description: 生命在于折腾,又把博客折腾到Hexo了。给Hexo点赞。
hexo new photo "My Gallery"
变量 | 描述 |
---|---|
layout | 布局 |
title | 标题 |
date | 文件创建日期 |
以上是文章摘要 <!--more--> 如下是余下全文
hexo new page <title>
hexo new post <title>
变量 | 描述 |
---|---|
:title | 标题 |
:year | 创建的年份(4 位数) |
:month | 创建的月份(2 位数) |
:i_month | 创建的月份(去掉开头的零) |
:day | 创建的日期(2 位数) |
:i_day | 创建的日期(去掉开头的零) |
hexo n
#写文章hexo g
#生成hexo d
#部署 #可与hexo g
合并为 hexo d -g
ERROR Deployer not found: git
解决方法
npm install hexo-deployer-git --save
hexo 3.0 部署类型再也不是github
,_config.yml
中修改
bash# Deployment ## Docs: http://hexo.io/docs/deployment.html deploy: type: git repository: git@***.github.com:***/***.github.io.git branch: master
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
npm install bcrypt
npm install hexo-generator-feed --save
编辑hexo/_config.yml,添加以下代码:
rss: /atom.xml #rss地址 默认便可
1.我使用多说代替自带的评论,在多说 网站注册 > 后台管理 > 添加新站点 > 工具 === 复制通用代码 里面有 short_name
在根目录 _config.yml
添加一行 disqus_shortname: jslite
是在多说注册时产生的
复制到 themes\landscape\layout\_partial\article.ejs
把
<% if (!index && post.comments && config.disqus_shortname){ %> <section id="comments"> <div id="disqus_thread"> <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> </section> <% } %>
改成
html<% if (!index && post.comments && config.disqus_shortname){ %> <section id="comments"> <!-- 多说评论框 start --> <div class="ds-thread" data-thread-key="<%= post.layout %>-<%= post.slug %>" data-title="<%= post.title %>" data-url="<%= page.permalink %>"></div> <!-- 多说评论框 end --> <!-- 多说公共JS代码 start (一个网页只需插入一次) --> <script type="text/javascript"> var duoshuoQuery = {short_name:'<%= config.disqus_shortname %>'}; (function() { var ds = document.createElement('script'); ds.type = 'text/javascript';ds.async = true; ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js'; ds.charset = 'UTF-8'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ds); })(); </script> <!-- 多说公共JS代码 end --> </section> <% } %>