Skip to content

Commit

Permalink
jekyll 3 article wording
Browse files Browse the repository at this point in the history
  • Loading branch information
marcgg committed Mar 13, 2016
1 parent a23a088 commit 7db5253
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
28 changes: 15 additions & 13 deletions _posts/2016-03-14-github-pages-jekyll.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
---
layout: post
title: "Trailing Slashes, Github Pages & Jekyll 3"
title: "Trailing Slashes, Github Pages, Jekyll 3 & 404s"
description: "Because of Github Pages' change from Jekyll 2 to 3, it broke my website and many others because of a change in trailing slashes behavior."
blog: false
category: blog
tag: Dev
---

A month ago Github [announced][1] that it was now running Jekyll 3. At this point I already tried to upgrade but ran into so many issues I gave up, so I was still building my site with Jekyll 2... but looking at the announcement I figured that it was no big deal since every major deprecations would only occur in May.
A month ago Github [announced][1] that it was now running Jekyll 3. At this point I already tried to upgrade but ran into so many issues I gave up, so I was still building my site with Jekyll 2.

Looking at the announcement I figured that it was no big deal since every major deprecations would only occur in May. It really felt quite safe to stay with Jekyll 2 and migrate in a month or two.

Big mistake.

## The Symptoms

A few weeks later, while checking my analytics, I noticed that my view count was dropping slowly:
A few weeks later, while checking my analytics, I noticed that my view count was dropping slowly but surely:

<div class="image-wrapper" style="text-align: center"><img src="/assets/blog/analytics-drop.jpg" alt="Google analytics drop" style="padding: 20px; width: 600px;"/></div>

I thought that there was some algorithm change and didn't bother digging more into it until I later checked Google Webmaster tools and saw a large increase in crawling errors arround the same time:
I thought that there was some algorithm change on Google's side and didn't bother digging more into it... until I later checked Google Webmaster tools and saw a large increase in crawling errors arround the same time!

<div class="image-wrapper" style="text-align: center"><img src="/assets/blog/webmaster-tools.jpg" alt="Google webmaster tools drop" style="padding: 20px; width: 600px;"/></div>

_Note that this only occured mid Febuary and not right when Github started using Jekyll 3 because this was the moment when I published [a new article][2] and rebuilt my site, busted my cache and so on. This made the whole experience even more confusing._

## The Issue & How To Solve It

Since this site is not my main focus, I could only investigate a bit later on, but I found that this was due to a major change in Jekyll 3 regarding trailing slashes as explained in the [migration guide][2].
Since this site is not my main focus, I could only investigate later on. Once I found some time I understood that this was due to a major change in Jekyll 3 regarding trailing slashes as explained in the [migration guide][3].

> In Jekyll 2, any URL constructed from the permalink: field had a trailing slash (/) added to it automatically. Jekyll 3 no longer adds a trailing slash automatically to permalink: URLs. This can potentially result in old links to pages returning a 404 error.
At this point my configuration at the time looked like this:
At this point my configuration at the time looked like this, with no trailing slash explicitely mentionned:

permalink: /:categories/:year/:month/:day/:title

A lot of my inbound links had a trailing slash but I never really paid any attention to this since it was working properly until then. Once this trailing slash logic stopped working on Github Pages, I lost a lot of links, dropped terribly in SEO and lost all my traffic in the course of a few weeks.
A lot of external links pointing to my blog had trailing slashes but I never paid any attention to this since it was working properly until then. Once this trailing slash logic stopped working on Github Pages, I lost a lot of links, dropped terribly in SEO and lost all my traffic in the course of a few weeks.

Ouch.

This only occured mid febuary and not right when Github started using Jekyll 3 because this was the moment when I published [a new article][3] and rebuilt my site, busted my cache and so on.

I fixed the issue by adding explicitely the trailing slash to the `permalink` configuration, and I'm started to see my stats going back up again.
I fixed the issue by adding explicitely the trailing slash to the `permalink` configuration, and I started to see my stats slowly going back up again.

permalink: /:categories/:year/:month/:day/:title/

It's a bit of a shame that such a breaking change was released somewhat under the radar, and I'm wondering how many websites are now returning 404s because of it. The positive side of this is that the Jekyll team did take this [into account][4] and [updated their documentation][5].
It's a bit of a shame that such a breaking change was released somewhat under the radar. I'm wondering how many websites are now returning 404s because of it. The positive side of this is that the Jekyll team did take this [into account][4] and [updated their documentation][5].

The only sure thing is that from now on I'll try to pay more attention to my blog's analytics!

[1]: https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0
[2]: https://jekyllrb.com/docs/upgrading/2-to-3/
[3]: /blog/2016/02/15/rspec-on-multiple-rails-projects/
[2]: /blog/2016/02/15/rspec-on-multiple-rails-projects/
[3]: https://jekyllrb.com/docs/upgrading/2-to-3/
[4]: https://github.com/jekyll/jekyll/issues/4440
[5]: https://talk.jekyllrb.com/t/github-pages-with-jekyll3-blog-posts-with-trailing-slash-no-longer-work/1877/3
2 changes: 1 addition & 1 deletion _site/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>marcgg#blog</title>
<link href="https://marcgg.com/atom.xml" rel="self"/>
<link href="https://marcgg.com"/>
<updated>2016-03-13T20:12:09+01:00</updated>
<updated>2016-03-13T20:25:57+01:00</updated>
<id>https://marcgg.com</id>
<author>
<name>Marc G Gauthier</name>
Expand Down
26 changes: 14 additions & 12 deletions _site/blog/2016/03/14/github-pages-jekyll/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>
Trailing Slashes, Github Pages & Jekyll 3
Trailing Slashes, Github Pages, Jekyll 3 & 404s
</title>
<meta name="description" content="Because of Github Pages' change from Jekyll 2 to 3, it broke my website and many others because of a change in trailing slashes behavior.">
<meta name="author" content="Marc G Gauthier">
Expand Down Expand Up @@ -36,7 +36,7 @@
<h1>
<span>

Trailing Slashes, Github Pages & Jekyll 3
Trailing Slashes, Github Pages, Jekyll 3 & 404s


</span>
Expand All @@ -52,47 +52,49 @@ <h1>
<div class="post" id="post-">


<p>A month ago Github <a href="https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0">announced</a> that it was now running Jekyll 3. At this point I already tried to upgrade but ran into so many issues I gave up, so I was still building my site with Jekyll 2… but looking at the announcement I figured that it was no big deal since every major deprecations would only occur in May.</p>
<p>A month ago Github <a href="https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0">announced</a> that it was now running Jekyll 3. At this point I already tried to upgrade but ran into so many issues I gave up, so I was still building my site with Jekyll 2.</p>

<p>Looking at the announcement I figured that it was no big deal since every major deprecations would only occur in May. It really felt quite safe to stay with Jekyll 2 and migrate in a month or two.</p>

<p>Big mistake.</p>

<h2 id="the-symptoms">The Symptoms</h2>

<p>A few weeks later, while checking my analytics, I noticed that my view count was dropping slowly:</p>
<p>A few weeks later, while checking my analytics, I noticed that my view count was dropping slowly but surely:</p>

<div class="image-wrapper" style="text-align: center"><img src="/assets/blog/analytics-drop.jpg" alt="Google analytics drop" style="padding: 20px; width: 600px;" /></div>

<p>I thought that there was some algorithm change and didn’t bother digging more into it until I later checked Google Webmaster tools and saw a large increase in crawling errors arround the same time:</p>
<p>I thought that there was some algorithm change on Google’s side and didn’t bother digging more into it until I later checked Google Webmaster tools and saw a large increase in crawling errors arround the same time!</p>

<div class="image-wrapper" style="text-align: center"><img src="/assets/blog/webmaster-tools.jpg" alt="Google webmaster tools drop" style="padding: 20px; width: 600px;" /></div>

<p><em>Note that this only occured mid Febuary and not right when Github started using Jekyll 3 because this was the moment when I published <a href="/blog/2016/02/15/rspec-on-multiple-rails-projects/">a new article</a> and rebuilt my site, busted my cache and so on. This made the whole experience even more confusing.</em></p>

<h2 id="the-issue--how-to-solve-it">The Issue &amp; How To Solve It</h2>

<p>Since this site is not my main focus, I could only investigate a bit later on, but I found that this was due to a major change in Jekyll 3 regarding trailing slashes as explained in the <a href="https://jekyllrb.com/docs/upgrading/2-to-3/">migration guide</a>.</p>
<p>Since this site is not my main focus, I could only investigate later on. Once I found some time I understood that this was due to a major change in Jekyll 3 regarding trailing slashes as explained in the <a href="https://jekyllrb.com/docs/upgrading/2-to-3/">migration guide</a>.</p>

<blockquote>
<p>In Jekyll 2, any URL constructed from the permalink: field had a trailing slash (/) added to it automatically. Jekyll 3 no longer adds a trailing slash automatically to permalink: URLs. This can potentially result in old links to pages returning a 404 error.</p>
</blockquote>

<p>At this point my configuration at the time looked like this:</p>
<p>At this point my configuration at the time looked like this, with no trailing slash explicitely mentionned:</p>

<div class="highlighter-rouge"><pre class="highlight"><code>permalink: /:categories/:year/:month/:day/:title
</code></pre>
</div>

<p>A lot of my inbound links had a trailing slash but I never really paid any attention to this since it was working properly until then. Once this trailing slash logic stopped working on Github Pages, I lost a lot of links, dropped terribly in SEO and lost all my traffic in the course of a few weeks.</p>
<p>A lot of external links pointing to my blog had trailing slashes but I never paid any attention to this since it was working properly until then. Once this trailing slash logic stopped working on Github Pages, I lost a lot of links, dropped terribly in SEO and lost all my traffic in the course of a few weeks.</p>

<p>Ouch.</p>

<p>This only occured mid febuary and not right when Github started using Jekyll 3 because this was the moment when I published <a href="/blog/2016/02/15/rspec-on-multiple-rails-projects/">a new article</a> and rebuilt my site, busted my cache and so on.</p>

<p>I fixed the issue by adding explicitely the trailing slash to the <code class="highlighter-rouge">permalink</code> configuration, and I’m started to see my stats going back up again.</p>
<p>I fixed the issue by adding explicitely the trailing slash to the <code class="highlighter-rouge">permalink</code> configuration, and I started to see my stats slowly going back up again.</p>

<div class="highlighter-rouge"><pre class="highlight"><code>permalink: /:categories/:year/:month/:day/:title/
</code></pre>
</div>

<p>It’s a bit of a shame that such a breaking change was released somewhat under the radar, and I’m wondering how many websites are now returning 404s because of it. The positive side of this is that the Jekyll team did take this <a href="https://github.com/jekyll/jekyll/issues/4440">into account</a> and <a href="https://talk.jekyllrb.com/t/github-pages-with-jekyll3-blog-posts-with-trailing-slash-no-longer-work/1877/3">updated their documentation</a>.</p>
<p>It’s a bit of a shame that such a breaking change was released somewhat under the radar. I’m wondering how many websites are now returning 404s because of it. The positive side of this is that the Jekyll team did take this <a href="https://github.com/jekyll/jekyll/issues/4440">into account</a> and <a href="https://talk.jekyllrb.com/t/github-pages-with-jekyll3-blog-posts-with-trailing-slash-no-longer-work/1877/3">updated their documentation</a>.</p>

<p>The only sure thing is that from now on I’ll try to pay more attention to my blog’s analytics!</p>

Expand Down

0 comments on commit 7db5253

Please sign in to comment.