Freddy Ewald Personal Website

Improving Search Engine Optimization

As the final step in this very small series I tried improving the SEO (search engine optimization) score for my start page. I started out with a good score of 92. As usual, my goal was 100.

Lighthouse score of 92 for

As a first step I had to fix a broken link in one of my articles. One forgotten href in a post needed to be fixed. Fixing this issue did not change the score.

Meta description

The start page didn’t have an HTML meta description, so I added one. I followed the best practices outlined here.

  • Use a unique description for each page
  • Clear and concise descriptions
  • Avoid keyword stuffing
  • No complete sentences needed, can be structured data

Furthermore descriptions should be less than 160 characters to appear completely in search results.

<meta name="description" content="...">

For the home page I chose a static description whereas for each individual post I wanted to either use the first 160 characters or, if provided, use an individual meta description. I achieved this with the following code in the templates.

{% case page.layout %}
{% when "post" %}
{% if page.meta_description == nil %}
    {% assign meta_description = page.excerpt | strip_html | strip_newlines | truncate: 160, "... read more" %}
{% else %}
    {% assign meta_description = page.meta_description %}
{% endif %}
{% when "page" %}
{% unless page.meta_description == nil %}
    {% assign meta_description = page.meta_description %}
{% endunless %}
{% else %}
{% assign meta_description = site.meta_description %}
{% endcase -%}

{% unless meta_description == nil %}
<meta name="description" content="{{ meta_description }}">
{% endunless -%}

This change brought the score to 100 and concluded my improvements for now.

Lighthouse score of 100 for blog at

I am I started this blog in late 2015, mostly as a digital business card when I bought this domain. Soon after, I started writing down observations and things that I learned during my work or free time. I am deeply interested in all aspects around software, the internet and teamwork. You can find more information about me on the about page.