Use Jekyll to build a blog on GitHub

Source: Internet
Author: User

Recently in the play GitHub, suddenly found a lot of instructions on the site or some of the introduction page all in a domain name is *****.github.io.

Curious!!! Really curious!!! How did you do that? I also want a ~ ~ ~

So went to the website to inquire about, found the official website of https://pages.github.com/.

Only HTML static pages can be written. At the bottom, we found a github-recommended Jekyll.

Jekyll Original website is in English, here is a translation of the website: http://jekyll.bootcss.com/. But it seems that some days have not been updated, or recommended to look back to the official website.

So, through the Jekyll, opened the GitHub website building Road.

1. Open terminal, any path execution: Gem install Jekyll

Throw exception:

error:while executing gem ... (Gem::filepermissionerror) you do not have the Write permissions for the/library/ruby/gems/2.0.0 directory.

Workaround:

sudo gem install Jekyll

2. Create a project on GitHub Username.github.io

3. Pull Project to Local

4. In terminal, arbitrary path execution: Jekyll new Username.github.io

5. Copy the generated files to the GitHub project directory that you just pulled.

6. Synchronize the code, upload ~ Visit Username.github.io, you can see, the blog is built to complete.

7. Run locally, switch to project directory, execute: Jekyll serve

8. Execute in the browser: http://127.0.0.1:4000/, you can see and username.github.io the same page content.

9. To stop the service, close its process in terminal. "[1]+ Stopped Jekyll Serve" will be displayed in terminal.

10. The following error is likely to occur when booting again:

[2016-04-22 22:51:20] WARN TCPServer error:address already in Use-bind (2) Jekyll 3.1.3 | Error:address already in Use-bind (2)

Cause:

The wrong command was used when closing, not command+c, but control+c.

Workaround:

A. Use command: PS aux | grep Jekyll Find to process number

B. Using the command: Kill-9 28185 kills the process (where 28185 is the process number)

11. Open the _config.yml file to modify many of the contents of the file presentation. Such as:

12. Browse the webpage again, and it will be found that the content of the webpage has been changed. Hey? What about Chinese? What about the fireworks with different colors? Such as:

Workaround: Very simple ... Change to an IDE ... This is a coding problem ...

Before using vs code, OK, coding problems, switching to atom, problem solving ...

Say, so can I give a bug to vs code? ...

Attached is my GitHub page connection address: http://lunagao.github.io/

Use Jekyll to build a blog on GitHub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.