Change site content and design based on context

I just spent a fair while barking up the wrong tree on this and figured I should just ask the experts.

I’ve built my Jekyll site using the minimal-mistakes theme and am quite happy with it. I would, however, like to be able to have it look different and change content in particular contexts. I have two domains, one personal and one professional. I would like the professional site to contain a subset of the site content and use a different skin and logo. I feel like it should be possible to reuse content rather than maintain two separate sites. I’m fine with the build generating separate site files, but I’d like to stick to unique source files.

I was trying to come up with some way of passing the domain from javascript to liquid, but I realize now that makes no sense. I’m drawing a blank now. Any clever ideas? Thanks in advance.

First I would suggest thinking about what your overall goal is and if duplicating content makes sense. It is far simpler to focus content that is different on each site and then make a hyperlink to the other site where you need to.

If you do indeed want to duplicate content, I have tips.

I answered a post in Jan on something similar to your question. You can use a submodule or clone process to pull in your content from a single third repo of content only, that gets used by the two Jekyll sites.
You can pull in from the frontend as well with JS but that is bad for crawlers due to the JS loading needed.

you also need to be aware of this damaging your SEO ranking. Unless you choose one site to be the “original” one and in the other one you put a canonical metadata tag that links to the original.

Interesting. I hadn’t considered the SEO end of things. I sort of imagined it being a site people would only reach if I gave them the address, but you never know. I’ll take a look at the earlier solution after I’ve given some further thought to how I want to present things. I appreciate the fresh perspective.

Google rejects duplicate content but does not penalize it. What it does is filter it so that it does not appear in its results, which is enough punishment.However, sites that copy and/or rewrite the content of others in a systematic way are penalized. The famous Panda algorithm was designed for that mission.

Source: Duplicate Content on Google: The Complete Guide

Just thinking out loud: Could git branches be a solution here? Anyone?

1 Like

Thanks for the info and link.

Can you elaborate on what would be achieved by git branching?

The premise underlying my clone + copy at build time or git submodule approach is that you have one version of the original content in version control and then copy to the two other repos that build using the content.
Well you could do this with 2 instead of 3 repos but it makes things cleaner I think to have 3 and separate content from the rest of the site.

The problem with copy and pasting your content by hand in two repos, or of having a second branch in a repo that has additional content and styling changes, is how do you keep them in sync?

The repos or branches will diverge.

Unless you know you will never rename move or delete or update content of an existing page (very restrictive). Or you make the identical change in both versions every time which is tedious and error prone (you’ll forget)