Github Pages
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:
- Could not locate Gemfile: ruby on rails - bundle install returns “Could not locate Gemfile” - Stack Overflow
- Could not find ‘bundler’: Why do I get
Could not find 'bundler' (1.17.3)
after upgrading Ruby? - Stack Overflow
Test
-
Open Git Bash.
-
Navigate to the publishing source for your site. For more information about publishing sources, see “About GitHub Pages.”
-
Run
bundle install
. -
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:
教程:
- GitHub Pages 搭建教程 - 少数派
- 搭建一个免费的,无限流量的Blog—-github Pages和Jekyll入门 - 阮一峰的网络日志
- Github Pages + jekyll 全面介紹極簡搭建個人網站和部落格 - IT閱讀
模板与主题:
- 怎样做一个漂亮的 GitHub Pages 首页? - 知乎
- Jekyll Themes - jekyllthemes.dev
- Jekyll Themes - jekyllthemes.org
- TeXt Theme - TeXt Theme