天天看點

hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建

 檢視效果 https://curoiusby.github.io/ https://curoiusby.github.io/2018/07/17/%E7%AC%AC%E4%B8%80%E7%AF%87-linux-hexo-%E5%AE%89%E8%A3%85%E8%AF%A6%E7%BB%86/

hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建
hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建

hexo 搭建

Jul 17, 2018 | 

linux

文章目錄

  1. 1. 準備工作
    1. 1.1. 安裝 node
    2. 1.2. 安裝 git
    3. 1.3. 安裝 python
  2. 2. 安裝 hexo
    1. 2.1. 安裝hexo本地
    2. 2.2. 安裝hexo 發步到github

準備工作

安裝 node
安裝 git
安裝 python      

安裝 node

去逛網下載下傳 node-v6.11.2-x64.msi,或者去csdn 下載下傳,csdn 下載下傳速度快一點

反正下載下傳好msi檔案後,輕按兩下打開安裝,也是一路next,不過在Custom Setup這一步記得選 Add to PATH,這樣你就不用自己去配置電腦上環境變量了,裝完在按 win + r 快捷鍵調出運作,然後輸入cmd确定,在cmd中輸入path可以看到你的 nod e 是否配置在裡面(環境變量),沒有的話你就自由發揮吧

測試檢視: node -v
v6.11.2

npm -v(安裝nod e  後就存在npm了)
3.10.10

npm update -g (版本比較低,更新一下,并下載下傳庫)

npm -v
6.1.0      

安裝 git

下載下傳git安裝檔案,輕按兩下執行安裝

git config --global user.name "你的GitHub使用者名"
git config --global user.email "你的GitHub注冊郵箱"

ssh-keygen -t rsa -C "你的GitHub注冊郵箱"

将公鑰添加到github:
使用者頭像→Settings→SSH and GPG keys→New SSH key→将id_rsa.pub中的内容複制到Key文本框中,然後點選Add SSH key(添加SSH)按鈕

ssh-add /c/Users/baoy/.ssh/id_rsa

測試是否聯通
ssh -T [email protected]

聯通封包

The authenticity of host 'github.com (53.72.123.109)' can't be established.
RSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,53.72.123.109' (RSA) to the list of known hosts.
Hi xxxx! You've successfully authenticated, but GitHub does not provide shell access.      

安裝 python

為啥安裝python? 
下面我們在安裝hexo 主題 maupassant的時候,會應用一個nod e 子產品node_modules/which/which.js.,which 中要求安裝python

下載下傳 :python-3.5.4rc1-amd64.exe 

安裝next ->到底

測試:
py -V
Python 3.5.4rc1      

安裝 hexo

安裝hexo本地

# 安裝hexo
npm install hexo-cli g

# 測試
hexo  -v

hexo: 3.7.1
hexo-cli: 1.1.0
os: Windows_NT 10.0.17134 win32 x64
http_parser: 2.7.0
node: 6.11.2
v8: 5.1.281.103
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2l

# 初始化部落格檔案夾
hexo init blog(mkdir blog && hexo init )
# 切換到該路徑
cd blog
# 安裝hexo的擴充插件
npm install
# 安裝其它插件
npm install hexo-deployer-git --save(送出到github 做準備)
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-generator-sitemap --save

# 清空已經釋出内容
hexo clean 

# 生成靜态檔案
hexo g (hexo generate)

# 釋出到github 上
hexo d (hexo deploy)

#本地啟動
hexo s (hexo server)


安裝hexo本地 , 隻需要指令
npm install hexo-cli g
npm install hexo-deployer-git --save
npm install
hexo init blog
hexo clean 
hexo generate
hexo server

# 啟動後效果
INFO  Start processing
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.      
https://curoiusby.github.io/2018/07/17/%E7%AC%AC%E4%B8%80%E7%AF%87-linux-hexo-%E5%AE%89%E8%A3%85%E8%AF%A6%E7%BB%86/hexo-github-3.png

http://localhost:4000/

安裝hexo 發步到github

# 安裝插件
npm install hexo-deployer-git --save

# 修改配置
(注意冒号後面有一空格)
deploy:
  type: git
  repository: [email protected]:curoiusby/curoiusby.github.io.git
  branch: master

hexo clean 
hexo generate
hexo deploy
(hexo d -g)

# 釋出成功後封包
INFO  Start processing
INFO  Files loaded in 2.02 s
INFO  Generated: index.html
INFO  Generated: img/BTCQR.png
INFO  Generated: img/WeChatQR.png
INFO  Generated: img/AliPayQR.png
INFO  Generated: img/github.svg
INFO  Generated: img/wechat.svg
INFO  Generated: img/paypal.svg
INFO  Generated: img/alipay.svg
INFO  Generated: img/bitcoin.svg
INFO  Generated: img/like.svg
INFO  Generated: archives/2018/index.html
INFO  Generated: archives/index.html
INFO  Generated: donate/index.html
INFO  Generated: archives/2018/07/index.html
INFO  Generated: js/codeblock-resizer.js
INFO  Generated: js/donate.js
INFO  Generated: js/search.js
INFO  Generated: js/fancybox.js
INFO  Generated: js/share.js
INFO  Generated: js/smartresize.js
INFO  Generated: js/totop.js
INFO  Generated: css/donate.css
INFO  Generated: css/style.css
INFO  Generated: css/default.css
INFO  Generated: 2018/07/16/第一篇-linux-hexo-安裝詳細/index.html
INFO  Generated: js/gitment.browser.js
INFO  26 files generated in 277 ms


hexo d
INFO  Deploying: git
INFO  Clearing .deploy_git folder...
INFO  Copying files from public folder...
INFO  Copying files from extend dirs...
warning: LF will be replaced by CRLF in css/default.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in css/donate.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in css/style.css.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in donate/index.html.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/codeblock-resizer.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/donate.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/fancybox.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/gitment.browser.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/search.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/share.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/smartresize.js.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in js/totop.js.
The file will have its original line endings in your working directory.
[master 1884519] Site updated: 2018-07-17 10:43:43
 5 files changed, 5 insertions(+), 5 deletions(-)
 rewrite "2018/07/16/\347\254\254\344\270\200\347\257\207-linux-hexo-\345\256\211\350\243\205\350\257\246\347\273\206/index.html" (66%)
 rewrite archives/2018/07/index.html (68%)
 rewrite archives/2018/index.html (68%)
 rewrite archives/index.html (68%)
 rewrite index.html (87%)

 # 檢視頁面
 https://curoiusby.github.io/      
https://curoiusby.github.io/2018/07/17/%E7%AC%AC%E4%B8%80%E7%AF%87-linux-hexo-%E5%AE%89%E8%A3%85%E8%AF%A6%E7%BB%86/hexo-github-4.png

https://curoiusby.github.io//

hexo

捐助開發者 

在興趣的驅動下,寫一個

免費

的東西,有欣喜,也還有汗水,希望你喜歡我的作品,同時也能支援一下。 當然,有錢捧個錢場(支援支付寶和微信 以及扣扣群),沒錢捧個人場,謝謝各位。

個人首頁

http://knight-black-bob.iteye.com/
hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建
hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建
hexo 搭建 自己的部落格系統(hexo, github,maupassant)hexo 搭建

 謝謝您的贊助,我會做的更好!