# 沒有個人網誌 為甚麼不試試看Hexo
> 國立雲林科技大學 FKT
---
### [Self Introduction](https://www.sql-fan9704.eu.org/)

---
### Hexo 介紹

---
### 環境安裝
> 假設環境已經擁有Node.js 且有yarn 或 npm可以跳過此步驟
----
### Node.js 安裝 前置作業(1/3)
[Node.js Download Link](https://nodejs.org/en/download/)
安裝完畢我們來安裝 yarn 好了
### Yarn 安裝 前置作業(2/3)
[Yarn Download Link](https://github.com/yarnpkg/yarn/releases/tag/v1.22.19)
> Yarn 與 Npm 的比較 參考下面
[Click Me](https://ithelp.ithome.com.tw/articles/10191745)
----
### 前置作業(3/3) 安裝最後一項 Hexo 本人
**NPM User**
``` bash=
npm install -g hexo-cli
```
**Yarn User**
``` bash=
yarn global add hexo-cli
```
就這樣環境完成了
---
### 正式開搞
##### Step.1 建立你的Hexo 專案folder
建立你要放入Hexo 專案的folder
> CMD User
``` cmd =
cd /Users/<username>/Desktop
mkdir MyBlog
cd MyBlog
```
> Bash User
``` bash=
cd ~
cd desktop
mkdir MyBlog
cd Myblog
```
----
##### Step.2 初始化Hexo 專案
透過 hexo-cli 來初始化(真的要確認好路徑ㄋㄟ)
``` bash=
hexo init
```
初始化完畢就會長這樣

----
###### 目錄結構

----
1. .github folder 放github資訊的資料夾
2. node_modules 安裝nodejs相關套件的資料夾
3. scaffolds 放模板的地方
4. source/_posts 放你文章的地方
5. themes 套用主題
----
1. _config.landscape.yml
2. _config.yml hexo設定檔
3. .gitignore 關於那些檔案是你不需要提交到git的
4. package.json nodejs專案套件檔
5. yarn.lock yarn處理套件版本的紀錄檔
----
##### Step.3 寫一篇你的新文章
```bash=
hexo new [套用的模板] <文章標題>
```

----
Hexo 就會幫你建立你剛剛的文章 MarkDown File
###### 標籤介紹
1. title 文章標題
2. date 文章日期
3. tags 文章類別
----
##### Step.4 Run 看看
Debug Mode
```bash=
hexo server
#或
hexo s
```
就會像這樣啦

----
關閉hexo Server 可以用ctrl +c or
```bash=
hexo stop
```
清除hexo快取
```bash=
hexo clean
```
----
##### Step.X 文章不滿意 繼續修改
非常簡單 寫內容就跟你寫README一樣(以下是個雲科資管死亡列車筆記範例)

一樣
```bash=
hexo server
```

真是U質(特別給那些不愛寫網頁的朋友非常友善)
----
##### Step.final 將Hexo產生靜態網頁並發布到GitHub Page
###### 產生靜態網頁
```bash=
hexo generate
#或者
hexo g
```
----
###### 部屬你的Hexo Blog-1
新建GitHub Repository來放置你的Blog
名稱[username].github.io
修改 _config.yml 放置你的專案位置
----
###### 部屬你的Hexo Blog-2
```bash=
hexo deploy
```
----
## Thanks Everyone
> I am [FKT](https://www.linkedin.com/in/gang-ting-fan-95885920a/)
> We are NYUST GDSC
> [Discord Link](https://discord.gg/hKsXDm29TR)

{"metaMigratedAt":"2023-06-17T09:55:43.733Z","metaMigratedFrom":"YAML","title":"沒有個人網誌 為甚麼不試試看Hexo","breaks":true,"contributors":"[{\"id\":\"4c8f8799-9dcd-430b-b7bc-8a5156d39d0b\",\"add\":2503,\"del\":16}]"}