Introduction

为何选择github:

优点:

  • 定制性强,属于静态网站
  • 学习git、web等开发与使用

缺点:

  • 麻烦:因为要在本地编辑然后部署代码,无论如何也比不上在网页上编辑一下就发出去的快速
  • 开发难度高:有一定的开发难度,学习周期长,需要有一定的web开发经验与知识
  • 百度SEO差:google上还好,github限制了百度的索引

Ref: 如何开始写技术博客,怎么选择? - 知乎

Install

Jekyll: 是一个静态网站生成器(官方推荐)

Step:

  • Install ruby: Download Ruby
  • install jekyll: gem install jekyll
  • change directories to your app, THEN run: bundle install

error message:

Test

  1. Open Git Bash.

  2. Navigate to the publishing source for your site. For more information about publishing sources, see “About GitHub Pages.”

  3. Run bundle install.

  4. Run your Jekyll site locally.

$ bundle exec jekyll serve

 Configuration file: /Users/octocat/my-site/_config.yml
            Source: /Users/octocat/my-site
       Destination: /Users/octocat/my-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 0.309 seconds.
 Auto-regeneration: enabled for '/Users/octocat/my-site'
 Configuration file: /Users/octocat/my-site/_config.yml
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

To preview your site, in your web browser, navigate to http://localhost:4000.

Ref: Testing your GitHub Pages site locally with Jekyll - GitHub Docs

Reference

Jekyll:

教程:

模板与主题: