简体   繁体   中英

How do I use Jekyll to support GitHub pages?

Ok, so I registered a subdomain with my DNS provider, I have made a repository on GitHub for the subdomain (CNAME and all) i'd like to make it a blog and apparently the best blog software which works with GitHub pages is Jekyll. I have installed Jekyll from chocolatey, which is supposed to be the best way to do it with Windows, but I still dont know how to get GitHub pages working with Jekyll. Does anyone know?

To create a site on Github Pages you need to create a gh-pages branch using git and push that branch to Github. Your new site will be username.github.io/baseurl.

Hope that helps!

The only thing you need to do is setup a directory structure in your gh-pages branch that Jekyll can understand. The rest happens pretty much automatically.

Here is the guide I followed, and it focuses on getting the directory structure setup instead of installing stuff locally.

Here is another description of the directory structure you need to setup.

But the very basic structure you need is this:

  • _config.yml : contains settings for your site
  • _layouts/default.html : contains the layout html for your site
  • _posts/2016-06-15-hello-world.md : Contains a post for your blog.

You can expand from there, but the basic answer is that you just need the correct directory structures, and everything else should happen automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM