Playing it safe with Google's web tools

Just for the heck of 'doing-it-right', I enrolled all my sites into Google's Analytics and subjected them to Google Webmaster's tools. I'd check them from time to time to set some updates and fix reported errors.

Google Webmaster's tools is quite a handy measure for beginners who don't know where to start with their site monitoring or how to improve their pages the way Google sees it.

alt text

alt text

What has been confusing was that, Google reports multiple instances of the same title tag for some of my pages. This doesn't happen with Wordpress though. Since I just ported a Wordpress theme look to mephisto, I wondered if it was just my fault and if ever, how could I fix it. I looked into the default mephisto theme, and found this in the layout:


<title>{{ site.title }} {% if article %} {{ article.title }} {% else %} {{ site.subtitle }} {% endif %}</title>

This sets the title to the title of the article when an article is present, but to the site subtitle for pages such as article archive, tag archive, page or even section archive. Some mephisto themes (like skittlish) support the change in the page title (for its archives, dunno for the tag archives). I haven't tried skittlish myself, but here's my take on how you can make your mephisto pages have unique titles:

  • In your themes directory (or whichever path you have your theme in), create a new file called titleheader.liquid (or whatever you'd have it called) inside the templates directory.

  • Put the following code in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
{% if article %}
  <meta name="description" content="Put your site description here.  Put an intro to article here '{{ article.title }}'."/>  
  <meta name="keywords" content="put, your, default, keywords, here, separated, by, commas, {{ article.title }}"/>
{% endif %}
{% if section %} 
  {% if section.name == 'Home' and archive_date %}
    <meta name="description" content="Put your site description here.  Put an intro to the archive date {{ archive_date | format_date: 'my'}} articles."/>    
    <meta name="keywords" content="put, your default, keywords, here, separated, by, commas, {{ archive_date | format_date: 'my'}}"/>
  {% else %}
    <meta name="description" content="Put your site description here.  Put an intro to the section archive {{ section.name }} articles."/>
    <meta name="keywords" content="put, your default, keywords, here, separated, by, commas, {{ section.name }}"/>
  {% endif %}
{% endif %}
  • In your layout.liquid, find the meta tag with the content-type and put the following code:
1
2
  <meta content="application/xhtml+xml; charset=utf-8" http-equiv="content-type"/>
  {% include 'title_header' %}

And, that's it! Save your templates, and give it a restart. You should be able to get rid of the Google webmaster errors in its diagnostics section. If you're interested to find out more about the archiving, you can start here or explore the codes of skittlish theme.

Feel free to leave me a message if you enjoyed this post. wink

Leave a Reply

Hi, I've been busy you know. wink If you don't know yet, this site and my blog codes are hosted in . I recently moved to Git and found that they have support for private Git repositories. Below are details of my last git push.

Maricris S. Nonato on 14 Feb
Commit: 48fe3652ffb644af13f4a5651f9d80474b09f622

Adding new ad image for Pledgie campaign - campaign image for coderkitty fundraising
  • my mom is preventing me from doing work.. distracting me by offering fruits. sigh.. 2010-03-11
  • while creating mockups, i even find myself thinking in partials.. hmm.. too much ROR 2010-03-11
  • RT @makieduardo: "Keep me safe, O God... for in you I take refuge." (Psalm 16:1) 2010-03-11
  • @packetlog Philosophies of India? That wasn't in my list, but if you think its worth the read, then why not?! smile 2010-03-11
  • i'm on a voyage to read over 1101 books! smile 2010-03-10
  • @nightdreamer vampires? lol. i don't even like them as much as a commoner.. wink whoops! not to pull on any string there! tongue 2010-03-10
  • why is it that i find myself attracted more to classic novels?? 2010-03-10
  • @codinghorror lol. i'd love to see that happen tongue 2010-03-10
  • @gregmoreno had a look at that a long time ago. isn't it expensive though? or is it worth it? 2010-03-10
  • it took 3 yrs for Kindle to be introduced globally.. i wonder how long i have to wait for Nook sad 2010-03-09
  • Kill the zombie browser!!! 'Funeral' held for aging Web browser - CNN.com http://bit.ly/brlGYF.. 2010-03-08
  • @holtaway http://twitpic.com/17cws.. - adorable!!! 2010-03-08
  • http://twitpic.com/17cwo.. - Its hard to work when this is your setup.. 2010-03-08
  • tea + ambient music. puts my soul at ease 2010-03-08
  • 15 Quality Web-Based Applications to Create Mock-Ups and Wireframes | Spyre Studios http://bit.ly/azTHis.. 2010-03-07
  • 10 Completely Free Wireframe and Mockup Applications - Speckyboy Design Magazine http://bit.ly/9xhgFw.. 2010-03-07