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
  • i miss JP sad :( :( 2010-03-19
  • frustration on books/ebooks and ereaders kicking in.. sigh. got to get my mind off them for now 2010-03-19
  • i am worth more than how you see me. my faith and belief in it is greater today than yesterday #fb 2010-03-19
  • nice.. http://bit.ly/dAr1Co.. 2010-03-19
  • There can be no happiness if the things we believe in are different from the things we do. - Freya Stark #fb 2010-03-15
  • LivingLife :: My first cabby receipt: Today seems a normal day.  I have good vibes for today.  smile  At first I f... http://bit.ly/cAZJiL.. #fb 2010-03-15
  • would you believe that Filipinos "trust" Lea Salonga second to Rosa Rosal (in Reader's Digests' Who do you trust poll)? weird. 2010-03-12
  • have you seen a chinese owl? i can't get this image out of my head: http://bit.ly/czilyD.. 2010-03-12
  • i just said this earlier before i got my mail from GodWhisper and it matches! http://bit.ly/b2ZWsy.. 2010-03-12
  • i don't like it when you start a business and all you think about is how to earn fast 2010-03-12
  • i am not inspired. i feel like there are monkeys at my back 2010-03-12
  • RT @crypticmess: RT @ihatequotes: Behind every untrusting woman is the guy who taught her to be that way. -Claudia Cardinale #ihatequotes 2010-03-11
  • @redbaks hahaha.. thanks! i'm up to it anyway! smile 2010-03-11
  • 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