最近被 nodejs 與 hexo 玩得不要不要的 (可見功力還不足阿) 所以改了這篇文章記錄一下
想要更清楚可以到 Hexo 官網他會有詳細和中文的教學
Step 1: 安裝 node js
由於 hexo 在文章部屬前可以先使用 node js 先跑在自己本機端上
而且部屬也是使用 node js 將 mark down 語法轉成 html 頁面
因此在安裝 hexo 前得先安裝 node js (連結)
Step 2: 安裝程式編輯器 (使用VS Code)
vs code 是微軟所開發的程式編輯器,它輕巧快速而且免費提供給大家做使用
而且你需要什麼工具就安裝什麼
是個跟sublime 、 nodepad ++ 一樣的好東西
Step 3: 安裝GIT
下載網址:http://git-scm.com/download/
Step 4: 使用 npm 安裝 hexo
打開cmd並打上
npm install hexo-cli -g //安裝hexo cli
Step 5: 創建部落格資料夾並使用 vs code 打開
接著在打上
cd Document/ //移至Document底下
mkdir blog //創造一個叫blog的資料夾
hexo init blog //新增想關資料到blog
cd blog/ //進入blog資料夾
npm install //安裝
code . //使用vs code 打開資料夾底下的東西
hexo s //使用本地端node js 跑 blog
你打開 127.0.0.1:4000 就會看到
Step 6: Hexo 資料夾講解
.deploy_git :底下是你文章 (markdown) 經過 hexo 解析後所長出來的html程式碼
Source :底下放著你所有的文章
themes :底下放著你想要引用的畫面
_config.yml : 裡面存放著各種設定
Step 7: 切換主題
hexo 內有許多主題可以進行選擇
你可以上 hexo 的 主題頁面 去尋找主題
你選擇後需要進入 github 並且將他 clone 下來放在你的 themes 底下
而我是選擇 yilia 這個主題
原因是因為他好修改程式碼
將主題放到 themes 資料夾後
修改 _config.yml 內的 theme 設定 把冒號後面改 yilia 就可以摟
Step 8 : 新增文章
要新增文章只要在 cmd 內打上
//hexo new "文章名稱"
hexo new "我的第一篇文章"
他就會幫你在source 底下的 _posts markdown 語法的文章喔
Step 9 : Markdown 語法學習
這個就不多解釋搂((老實說我也是 markdoen 新手,不過上手難度不高就是了
可以參考 教學網站 GitBook
部分文章參考至:令狐葱的前端筆記
下方是原文他放了些基本語法——————————————————————————-
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Create a new post
|
|
More info: Writing
Run server
|
|
More info: Server
Generate static files
|
|
More info: Generating
Deploy to remote sites
|
|
More info: Deployment