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 17 Oct
Commit: f1e0dcd18189caa211026c2f9e4bf1d886e05da1

Updating sidebar
  • awww.. i want this for Xmas: http://bit.ly/61u6JX.. 2009-11-28
  • @rands "you get what you give" ? smile 2009-11-28
  • If anybody knows where I could find hbh ds205, please let me know. Thanks! 2009-11-28
  • Where would I be without my guides! They're such good navigators. 2009-11-28
  • i hate sellers who deliberately ignore buyers. what's up with them anyway?? sheez 2009-11-27
  • @_randell oh.. i must be referring to somebody else. saw a prof of mine there din last time eh. wink 2009-11-27
  • @_randell who? is that Ma'am Pancho? tongue 2009-11-27
  • @_randell hah! pizza doesn't even sound inviting! lawl.. just kidding! wink i'll just watch out for updates.. and maybe some vid update ;) 2009-11-27
  • this is a handy list of reserved words in Rails: http://bit.ly/8xH76y.. 2009-11-27
  • thanks for the tip! RT @JeromeGotangco: This ATM at the Podium should be avoided: http://twitpic.com/r56jc.. it's like that everyday! 2009-11-27
  • @_randell sayang. i can't be there. LOL. 2009-11-27
  • hurray for UP!!! IT international team champion! smile what else is new? hahaha. wink 2009-11-27
  • lovin' them all! shoulda, rspec, factory girl and cucumber.. smile 2009-11-27
  • Get ready for the future! I'm not hiding anymore! smile Dear Universe, shower me with your love. Thank you God for the strength. :) 2009-11-27
  • For those massacred in Maguindanao: http://www.youtube.com/w..?v=uMRZRcmpYx8 2009-11-27
  • LivingLife :: Think positive: Best of it!: Share this on del.icio.usShare this on FacebookTweet This!Share this... http://bit.ly/56uaH1.. #fb 2009-11-27