Getting Jekyll running just for a subdirectory on Github
Asked Answered
A

2

6

I'm trying to set up a portfolio page using Github Pages. I'd like to have part of this include a blog, and have set up a /blog folder, where I created a new Jekyll project. The main site is not Jekyll powered, just this subdirectory.

When I start Jekyll on the subdirectory folder, it displays correctly. After uploading it to Github, however, everything seems to go wrong and nothing shows up. This can be seen at http://rjbman.github.io/blog/.

Is there anything special I need to do in order to have Jekyll run exclusively from this subdirectory? I searched around and found Site root: Github Pages vs. `jekyll --server`, but this didn't fix it for me.

All source code can be found at https://github.com/rjbman/rjbman.github.io

EDIT: Unfortunately I wasn't able to find a solution besides re-doing the site so the whole site ran Jekyll. Jekyll will still put any static html pages into the directory and added a lot of flexibility. And with the permalink option in the _config.yml, I'm still able to have everything under /blog/.

Ambros answered 1/5, 2014 at 21:36 Comment(0)
N
6

It seems that you have found a workaround since posting your question, but I'll answer this in case you (or others) are still interested.

There are two types of GitHub Pages sites:

  • User/Organization sites
  • Project sites

User/Organization sites are rooted at the top level like: http://rbonick.github.io/ and are on the master branch of the repo with the site name (i.e., rbonick.github.io).

Project sites are on the gh-pages branch of a repository and the URL is a concatenation of the USer/Org site URL + the name of the project site repository.

So, if you wanted to only use Jekyll for the blog part of your site, you could do the following:

  • make a repo called 'blog'
  • move your blog-related code (along w/ Jekyll-related code and config file) to your 'blog' repo on the gh-pages branch
  • modify _config.yml, etc. as needed to reflect this change
  • for convenience, goto GitHub settings for your blog repo and change the default branch to gh-pages if you have other branches in your blog repo

After doing that, http://rbonick.github.io should be working Jekyll-free as before and http://rbonick.github.io/blog/ should work as your Jekyll-based blog.

Newsman answered 29/10, 2014 at 20:0 Comment(0)
F
0

Nowadays you can configure Github Pages to publish the website based on a folder in a branch.

You may check more information at:

Floridafloridia answered 25/3, 2021 at 22:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.