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> <% } %>