First up, thanks heaps for Octopress! Love it!
Here's my setup:
The blog (deployed here) is being published to the /blogs sub-directory of an existing gh-pages branch, whose root has the main site. (As an aside, the rake deploy script has been tweaked slightly to accommodate the main site as well, to the effect that there is a git pull --rebase from gh-pages first, and then a git push).
Running on Windows 7, with Git Bash and Ruby 1.9.3 installed via RubyInstaller.
The blog source is here.
The issue I have is that the canonical link url in the category pages alone, are all with the / between blogs and blog missing.
After source\_includes\head.html was tweaked as below (to see the variables that are in play to generate the canonical url):
{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %}
+ <!-- site.url: {{ site.url }} -->
+ <!-- site.permalink: {{ site.permalink }} -->
+ <!-- page.url: {{ page.url }} -->
+ <!-- canonical: {{ canonical }} -->
<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">
...here are the excerpts from:
public\blogs\blog\archives\index.html ( good )
<!-- site.url: http://flickrdownloadr.com/blogs -->
<!-- site.permalink: /blog/:year/:month/:day/:title/ -->
<!-- page.url: /blog/archives/index.html -->
<!-- canonical: http://flickrdownloadr.com/blogs/blog/archives/ -->
<link rel="canonical" href="http://flickrdownloadr.com/blogs/blog/archives/">
public\blogs\index.html ( good )
<!-- site.url: http://flickrdownloadr.com/blogs -->
<!-- site.permalink: /blog/:year/:month/:day/:title/ -->
<!-- page.url: /index.html -->
<!-- canonical: http://flickrdownloadr.com/blogs/ -->
<link rel="canonical" href="http://flickrdownloadr.com/blogs/">
- and
public\blogs\blog\categories\general ( bad! )
<!-- site.url: http://flickrdownloadr.com/blogs -->
<!-- site.permalink: /blog/:year/:month/:day/:title/ -->
<!-- page.url: blog/categories/general/index.html -->
<!-- canonical: http://flickrdownloadr.com/blogsblog/categories/general/ -->
<link rel="canonical" href="http://flickrdownloadr.com/blogsblog/categories/general/">
So, I see that the page.url not starting with a / is what is causing the canonical link in the category pages to be generated incorrectly, but I do not know if this is just me alone or how I could fix this.
Could someone help please?
First up, thanks heaps for Octopress! Love it!
Here's my setup:
The blog (deployed here) is being published to the
/blogssub-directory of an existinggh-pagesbranch, whose root has the main site. (As an aside, therake deployscript has been tweaked slightly to accommodate the main site as well, to the effect that there is agit pull --rebasefrom gh-pages first, and then agit push).Running on Windows 7, with Git Bash and Ruby 1.9.3 installed via RubyInstaller.
The blog source is here.
The issue I have is that the
canonical linkurl in the category pages alone, are all with the/betweenblogsandblogmissing.After
source\_includes\head.htmlwas tweaked as below (to see the variables that are in play to generate the canonical url):{% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' }}{% endif %}{% endcapture %} + <!-- site.url: {{ site.url }} --> + <!-- site.permalink: {{ site.permalink }} --> + <!-- page.url: {{ page.url }} --> + <!-- canonical: {{ canonical }} --> <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">...here are the excerpts from:
public\blogs\blog\archives\index.html( good )public\blogs\index.html( good )public\blogs\blog\categories\general( bad! )So, I see that the
page.urlnot starting with a/is what is causing thecanonical linkin the category pages to be generated incorrectly, but I do not know if this is just me alone or how I could fix this.Could someone help please?