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 16 Jan
Commit: aa7640e30ade7a41faa4d42dab73af281817ff64

Removing ratified and updating me imageRemoving ratified and updating me image
  • 60 day SNS abstinence 2010-02-08
  • is it just me or multiply just keeps choking all the time ?? 2010-02-07
  • LivingLife :: Follow Me: I heard this song yesterday in the one place I hate the most. Must be a long long tim... http://bit.ly/agCNpt.. #fb 2010-02-07
  • the end justifies the means. that's how i feel right now 2010-02-06
  • don't ask how i am. apparently i'm still alive 2010-02-06
  • knock knock. D&L go away.. 2010-02-06
  • working more than two projects at the same time at the same place is draining me!!! 2010-02-05
  • i can't wait for Feb 12!!!!! 2010-02-04
  • get off the net (?) ..but i can't! sad sheezz 2010-02-04
  • i'm taking a round-robin trip around so many emotions in just a day! hopefully i end up with the best one. #fb 2010-02-04
  • @AdeMagnaye damn you're right! tongue 2010-02-03
  • is having some elevator blues.. i need a cone of silence. *bows and screams* 2010-02-03
  • @techpinas go Pidgin! wink 2010-02-03
  • men are like networks, or servers. i have my reasons LOL. 2010-02-03
  • I am sooo.. going to get this: http://bit.ly/8YDaLP.. soon smile 2010-02-01
  • ..on Do Not Disturb mode. Busy counting smiles smile 2010-02-01