如何用github 和hexo 建立一個bloghtml
- - 必須是io後綴。一個賬戶 只能創建一個
- 我的設置 -> SSH and GPG keys -> New SSH key - 測試 是否成功 ssh -T git@github.com =》You've successfully authenticated 表示成功 3.2 配置用戶名和郵件
$ git config --global user.name "liuxianan"// 你的github用戶名,非暱稱 $ git config --global user.email "xxx@qq.com"// 填寫你的github註冊郵箱java
npm install -g hexo
$ hexo g # 生成 $ hexo s # 啓動服務 hexo就會在public文件夾生成相關html文件,這些文件未來都是要提交到github去的: hexo s是開啓本地預覽服務,打開瀏覽器訪問 http://localhost:4000 便可看到內容
這裏咱們以8081端口爲例講解。git
按下Win+R調出命令行窗口,輸入netstat -aon|findstr "8081",找到指定行最後一列的數字(PID),咱們這裏是9548. 輸入tasklist|findstr "9548",發現是javaw.exe佔用了8081端口。 再次輸入taskkill /f /t /im javaw.exe結束該進程。github
//下載主題到themes/yilia 目錄 $ git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia 修改_config.yml中的theme: landscape改成theme: yilia,而後從新執行hexo g來從新生成
在根目錄下運行 $ npm i hexo-generator-json-content --save
jsonContent: meta: false pages: false posts: title: true date: true path: true text: false raw: false content: false slug: false updated: false comments: false link: false permalink: false excerpt: false categories: false tags: true
$ npm install hexo-deployer-git -save
deploy: type: git repository: git@github.com:homehe/homehe.github.io.git branch: master
我對個人文章負責,發現好多網上的文章 沒有實踐,都發出來的,讓人走不少彎路,若是你在個人文章中遇到沒法實現,或者沒法走通的問題。能夠直接在公衆號《愛碼農愛生活 》留言。一定會再次複查緣由。讓每一篇 文章的流程都能順利實現。npm