Browse code

removes index.html from canonical urls. closes #153

Brandon Mathis authored on 17/09/2011 at 14:40:14
Showing 1 changed files
... ...
@@ -18,8 +18,8 @@
18 18
   {% if page.keywords %}
19 19
     <meta name="keywords" content="{{page.keywords}}"/>
20 20
   {% endif %}
21
-
22
-  <link rel="canonical" href="{{ site.url }}{{ page.url }}"/>
21
+  {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
22
+  <link rel="canonical" href="{{ canonical }}">
23 23
   <link href="{{ root_url }}/favicon.png" rel="shortcut icon" />
24 24
   <link href="{{ root_url }}/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
25 25
   <script src="{{ root_url }}/javascripts/modernizr-2.0.js"></script>