aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOGINO Masanori <masanori.ogino@gmail.com>2012-05-28 17:21:26 +0900
committerOGINO Masanori <masanori.ogino@gmail.com>2012-06-02 11:14:12 +0900
commitf3c68bb73f4763c52dbdfc9d958707e3816d0475 (patch)
tree0d7f968211c7a4d64ce409d47396083ee22ad942
parente53b26ad3042d5657c869ab1961c35e7b716e4e9 (diff)
downloadmy_new_personal_website-f3c68bb73f4763c52dbdfc9d958707e3816d0475.tar.xz
my_new_personal_website-f3c68bb73f4763c52dbdfc9d958707e3816d0475.zip
Do not strip trailing slash of canonical URLs.
Usually, links for posts are generated with a trailing slash, but canonical URLs aren't. Some services (e.g. http://b.hatena.ne.jp/) are confused with that behavior. We can fix it by removing canonical URLs, but then anyone may read a post with /index.html URL and post the URL to some tool or service. Therefore rel="canonical" seems useful IMHO. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
-rw-r--r--.themes/classic/source/_includes/head.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/.themes/classic/source/_includes/head.html b/.themes/classic/source/_includes/head.html
index 0fdc4019..d7abd6fd 100644
--- a/.themes/classic/source/_includes/head.html
+++ b/.themes/classic/source/_includes/head.html
@@ -16,7 +16,7 @@
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
- {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}
+ {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
<link rel="canonical" href="{{ canonical }}">
<link href="{{ root_url }}/favicon.png" rel="icon">
<link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">