GitHub Pages and Jekyll content duplication and SEO issues
Asked Answered
D

1

6

I'm looking at using GitHub Pages to host my blog and Jekyll to present it.

Presumably, whatever I commit will appear at <yourname>.github.io through Jekyll and at https://github.com/<yourname>/<yourname>.github.io in rawer form. See this page showing links to live sites and to the source repos used to construct them.

Advice on SEO suggests that duplicating content within and across domains is bad SEO practice. See this Google support page on duplication and this Moz page on issues with duplication both of which also offer possible solutions.

My question is two-fold:

  • Is content duplication actually a problem for GitHub Pages in practice?
  • If so, how does one apply solutions like canonical linking or noindex to the GitHub repo so that search engines know that your Jekyll site is the canonical one?

Update:

Might be worth noting that I uploaded a "hello world" index file to my GitHub Pages repo and then checked the source for the page on GitHub. The GitHub source already contains a canonical link

<link rel="canonical" href="https://github.com/guypursey/guypursey.github.io/blob/master/index.html" data-pjax-transient>

I assume it's this that would need changing for each file to point to the Jekyll version of the site but I can't see a setting in GitHub to handle it.

Dip answered 24/1, 2016 at 17:38 Comment(0)
E
8

Duplicate content is unavoidable when using GitHub Pages with users and organizations if the repository is public

In general this shouldn't be a problem. See a previous answer.

You do have a couple of options:

  • Google and other search engines can't obviously access private repository which requires a paid plan.
  • Switch to a project page. This will use a gh-pages branch instead of the master branch. Since GitHub's robots.txt only allows search engine crawling of the master branch and disallows other branches. So if the site is in gh-pages branch this will prevent Google from seeing the repository.
Ellieellinger answered 25/1, 2016 at 8:33 Comment(2)
Thanks for your response. I have a paid plan so your first option might work for me but I don't know how it works with the github.io URL (i.e., whether it'll work when private). I'm going to read the previous answer more carefully this evening and try these options out. If I can get this to work I'll mark this answer correct.Dip
Switching my repo to private doesn't seem to have affected the serving of my pages so that'll work for me! If I go public again with the repo I'll consider switching the branches or switching to a project page as you suggest. Thanks for your help!Dip

© 2022 - 2024 — McMap. All rights reserved.