This is originally from Zhihu, but the magic editor of Zhihu, anti-human ah, so moved to nuggets. Happy, it looks like the Nuggets editor is ok, everything is great. In the future, I plan to write three series first: TSP, editor, and the third one is a bit like king of Glory for beginners.

The first zhihu column is how to write a blog on Github.

Github’s benefits:

  1. He has all the benefits of Git.
  2. Git is enough. Commit is gCAM (Git commit) and publish is GP (Git push).
  3. The Markdown format is currently the perfect github format for big companies. Although many niche Markdown formats are better (I remember a few), there is no platform-level support.

Of course, he also has shortcomings, otherwise why do I come to Zhihu BB, the only weakness:

  1. You can’t find it in China, so it’s hard to interact with you. If you want to interact, you should also interact on Github.
Without further ado, there are three steps to creating a blog on Github:
  1. Create a git project repository with your username.github. IO, for example: lornally. Github
  2. Git Clone github.com/lornally/lo…
# Create an index. HTML file in the root directory, don't take it too seriously, it will be overwritten in the future.
echo "Hello World" > index.html
# push to server
git add .
git commit -m"first"
git push
#'ll have to look at the effect in a browser: http://lornally.github.io
Copy the code
  1. No, there are only two steps. These two steps use Pages. See the Github documentation.
Enhanced, can consider using jekyII, very cool.

The key point is this: don’t look at github’s documentation, not clear, but jekyll’s own documentation. It was on this spot that I had a pain.

  1. The first step, installation, this place is the most prone to problems, please over the wall, shadowsok may not work, I was VPN out to fix. Or if you are familiar with Ruby, you can try to replace the source of Taobao with ruby.taobao.org. Taobao is reliable.
gem install jekyll
# continue in our previous local directory.
jekyll new . --force
Copy the code
  1. Step 2: At this point, you’re ready to blog in the _posts directory. Note the document format requirements. Date. Md, md stands for Markdown, e.g. 2009-04-26- I wrote a blog. Md

  2. Step 3: No more

# See the instructions for the next step, usually visit http://localhost:4000
# Open serve to enable local debugging.
jekyll serve
# push to making, can use http://lornally.github.io to see the effect.
Copy the code