Hi there, I can’t find a ‘howto’ for this, so here goes…
In my attempt to liberate my old blog from Wordpress and to start a new blog as well, I have built two Jekyll blogs in two different repos:
/jimken123/ohpiglet displaying on GitHub Pages as /ohpiglet/
/jimken123/nu-blog displaying on GitHub Pages as /nu-blog/
I own mydomain.com and I want to serve the two blogs as follows:
/nu-blog/ → mydomain
/ohpiglet/ → mydomain/ohpiglet
Q1. Is this possible from two repos or do I need to merge them? I’d prefer to keep them separate.
Q2. Should I use subdomains instead?
Q3. Is there a better way I haven’t seen?
If you plan to separate old content from new content, you could create a folder structure just as you suggest. Here’s a video I made a few years back that walks you through that “folder” method:
After you watch this video and try it out, you will understand how to lay out your site, and you might have more questions.
If you care about Google search rankings, you must carefully consider whether to retain the original site URLs for your old blog. If you create a brand new site with brand new URLs for your blog, then Google will treat that as “new” and not a “replacement,” so you will have to rebuild Google’s search engine trust again.
If you are unfamiliar with Jekyll site development, you might want to start with the first video in my series and watch through to the “multiple blogs and feeds” video I share above.
Also, I mention GitHub Pages a lot here, but most of this is generic Jekyll stuff, so do not worry if you are not limited to just GitHub Pages.
Thanks Bill! I think my usecase is somewhat different to yours in that my two blogs are completely different ((themes, configs, everything) - one is based on { Personal } Jekyll Theme and the other on Forever Jekyll. So a second _posts folder inside the first _post folder won’t be nearly enough, it will be more like an entire repo inside another repo, and that will get very messy very quickly…
Could you please explain what you use those two different blogs for and why they should be together but separate? By keeping Jekyll out of this for the moment, we can better understand your requirements and help you define a solution.
Sure! The main blog is about my kids, to keep in touch with my mother because we live abroad. It has ~4000 posts going back 14 years. The other one is new, intended for me talking about politics, books, whatever. So different audiences.
They are both already in Jekyll, one as a migration from WP and the other new.
So, here’s what I figured out from the replies here (thanks!), a lot of stackoverflowing, and a lot of trial and error.
If you want to pipe two repos (for example, foo and bar) to one website, there are three ways to do it:
Move one repo inside the the other one as a folder, so you have foo and foo/bar. Then ‘call’ each folder to a different url in the website, for example, foo → mydomain.com/ and foo/bar → mydomain.com/bar. I didn’t actually try this because it would be huge folders in my case, a maintenance nightmare, and there would be possible conflicts with competing index pages, config files, css, etc.
Submodules. Retain the repos foo and bar, but set up bar as a submodule inside foo. I didn’t actually try this way because it seems to be a maintenance headache afterwards, and tricky to push the correct repo updates.
The setup with Jekyll running on both types of repos is in an Enterprise org and not public, but here’s an example of two repos with the same URL structure: