3
votes

I have a Github pages site already up and running at http://pshrishi.github.io, where I have my resume posted at pshrishi.github.io/resume and a couple of other presentations at similar URLs/addresses like pshrishi.github.io/XYZ. I would like to host a blog at a URL like pshrishi.github.io/blog.

I have jekyll set-up on my MBP, and have been looking for a step-by step guide to go ahead with the blog. Any help would be appreciated, since I'd like the blog to go live as soon as possible.

I've listed the steps that I've tried so far, below:

  • cd pshrishi.github.io
  • Create a new jekyll project : jekyll new blog
  • Update the _config.yml file.
  • cd blog, and jekyll serve
  • The blog works just fine when I access it on my localhost at localhost:4000
3

3 Answers

2
votes

Your jekyll is not at the top level of the repo. Github is not able to read it.

Simply move your jekyll out from /blog onto the root directory of this repo.

Added:

Your current wrong setup is like the following:

/pshrishi.github.io
      /blog
          /<jekyll-content> 
          /index.html
          /_posts
          /_config.yml
          /blah-blah
      /resume
          /<jekyll-content-again> 
          /index.html
          /_posts
          /_config.yml
          /blah-blah

You should make the jekyll this way:

/pshrishi.github.io
    /<jekyll-content> 
    /index.html
    /_posts
    /_config.yml
    /blah-blah

Hope this helps :)

2
votes

As @ytbryan says, if your jekyll site is not at the root, it will not be generated by Github pages.

Two solutions :

1 - in your user repository pshrishi.github.io

  • put everything at the root
  • in _setting.yml, set permalink: /blog/:month-:day-:year/:title.html. this will generate your posts in /blog folder
  • put a link to your resume and other pages on the index page.

2 - in a blog repository

Just put your blog files in a gh-pages and all your Jekyll site will be accessible at pshrishi.github.io/blog

0
votes

A good solution to use such "sub-domains" through github would be to first create an organization in your name (e.g. pshrishi_organization). Then, you create your website/blog/resume as respective repositories in this organization (e.g. called blog). The github.io address pointing to the root of your blog.git repository will now be: pshrishi_organization.github.io/blog

The disadvantage of this approach is that you won't be able to use the root address available (pshrishi_organization.github.io) - at least I could not figure out how to do that, yet.