Friedrich Ewald My 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 fewald.net

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 fewald.net

About the author

is an experienced Software Engineer with a Master's degree in Computer Science. He started this website in late 2015, mostly as a digital business card. He is interested in Go, Python, Ruby, SQL- and NoSQL-databases, machine learning and AI and is experienced in building scalable, distributed systems and micro-services at multiple larger and smaller companies.