Hexo-使用靜態生成器,建立blog(3/3)變更主題

系列文章

複製主題到自己的專案

將別人的製作好的主題repository clone下來的時候,可能會連.git 一起 clone下來,出現「Git Submodule

Git Submodule」就是原先的repository中,還內嵌一到多個外部repository

  • 查看clone下來的repository是否含有.git
//進入themes資料夾,查看檔案列表
$ cd themes
$ ls -al
//進入內部主題資料夾,查看其中檔案列表
$ cd hiero
$ ls -al

  • 刪除內部主題資料夾中的.git
//強制刪除.git(-rf : recursive + force)
$ rm -rf .git
$ ls -al

  • 刪除快取
$ git rm --cached  themes/hiero -f
  • 查看尚未commit的當案
$ git status
  • 新增檔案
$ git add <file name>
  • 使用git管理檔案
$ git commit -m"<commit message>"
  • 檢視提交紀錄(也可以用soursetree檢視)
$ git log

  • 使用hexo產生靜態網頁
    hexo 是把產生出來的網站push到github(可以理解為,hexo的deploy指令會先把原始碼變成網站瀏覽器可以閱讀的程式碼 再push到github)
$ hexo deploy -g
Select a repo