Hacking Off

20% Time All the Time

Octopress 2.0 Default SEO Flaws

Minor, but present gripes:

  1. Canonical tags for Octopress categories and posts are slightly off. Directories (and blog posts) redirect to ending in a slash. The canonical tags produced take the form http://domain/blogdir/categories/category. The trailing slash is missing.

    .themes/classic/source/includes/head.html (DEFAULT)

    {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% else %}{{ page.url | remove:'index.html' | strip_slash }}{% endif %}{% endcapture %}

    .themes/classic/source/includes/head.html (FIXED)

    {% capture canonical %}{{ site.url }}{% if site.permalink contains '.html' %}{{ page.url }}{% elsif site.permalink contains category_dir %}{{ '/' | page.url | remove:'index.html' | '/' }}{% else %}{{ page.url | remove:'index.html' | '/' }}{% endif %}{% endcapture %}

    Note that, if you specify yaml _config.yml (problem) category_dir: categories as opposed to yaml _config.yml (fixed) category_dir: /categories The canonical tags for categories will be entirely broken, taking the form: http://domain/blogdircategories/category (see: missing slash in the middle of the link). It would be more consistent to have users forego the leading slash, and to add another ’/’ | to the canonical tag for a category URL.

  2. Meta description for the blog index takes the meta-desc of the first post, rather than contents of the description field from _config.yml. Unsure how to change this.

  3. Posts are redirected to a trailing slash. http://domain/dir/post gets redirected to http://domain/dir/post/. This isn’t an SEO matter so much as an aesthetic one. Unsure how to change this.

2 is minor and 3’s a matter of taste, so I haven’t hunted the source of either down. Yet.