將 HEXO 從 Ubuntu 遷移到 windows

來源:互聯網
上載者:User

標籤:

發現 windows 下的 Node.js 已經很易用了,於是決定把 Hexo 遷移到 windows 下。
直接複製是不可取的。
我的方法是將 hexo 的主題和 source 檔案夾拷貝過來,其他內容手動設定。

本文的前提:
系統安裝了 Node.js 和 Git。
本文中的所有命令均在 Git Bash 中執行,而不是在 CMD 中。
如果你安裝了 GitHub for Windows 的話,Git shell 會是一個更好的選擇。

拷貝需要的檔案

需要拷貝以下檔案夾:

  • hexo/source
  • hexo/themes/ 你的主題檔案夾
    和以下檔案:
  • hexo/_config.yml
  • packge.json
在 windows 部署新的 Hexo
  1. 在你想要部署 hexo 的檔案夾運行命令:hexo init,建立一個新的 Hexo 目錄。
  2. 將拷貝的 packge.json 檔案複製到新的 hexo 目錄下,覆蓋原來的檔案。
  3. 執行 npm install 安裝依賴包。
  4. 拷貝剩下的兩個檔案夾和 _config.yml 到對應位置。
  5. 運行 hexo g產生部落格。
  6. 運行 hexo s -o 查看你的部落格。
    ps. 如果開啟 http://0.0.0.0:4000/ 無法訪問的話,嘗試開啟http://localhost:4000/

完工。

 

將 HEXO 從 Ubuntu 遷移到 windows

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.