此為套用了主題 hexschool
的完整 Hexo 専案,開箱即用
專案設置(Project setup)
將專案複製到本地端
$ git clone git@github.com:hexschool/2024-camp-hexo.git
基礎套件安裝
$ cd 2024-camp-hexo
$ npm install
執行專案(Start the server)
$ hexo server
新增文章(Create a new post),建議以 Kebab case 進行命名。例如:your-post
$ hexo new post <your-post-name>
生成靜態檔案(Generate static files)
$ hexo generate
清除靜態檔案(Clear static files)
$ hexo clean
Step 1: 將圖片存放至 /source/images
Step 2: 在文章中以 ![](/images/your-image.png)
方式載入
在 /themes/hexschool/source/scss/_custom.scss
中新增
Step 1: 安裝 Live Sass Compiler(若已安裝可略過此步驟)
Step 2: 點擊 VS Code 下方的 Watch Sass
按鈕
Step 3: 點擊 /themes/hexschool/source/scss/all.scss
並按下儲存快捷鍵
MacOS 使用 cmd + s,Windows 使用 ctrl + s
Note: 編譯完成的檔案會出現在 /themes/hexschool/source/css/all.min.css