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

    Continue reading

  • Improving Website Accessibility

    Continuing from before, I wanted to improve the accessibility on this website as much as possible. The initial Lighthouse run gave me a score of around 82, which is not too bad, but I definitely wanted to improve it.

    Continue reading

  • Improving Page Speed

    One important thing for a good user experience is a fast website. Google offers the free tool Page Speed Insights. Running it initially on my website I already have a score of 99, which is pretty good. In the past I already spent a fair amount of time optimizing the bigger problems. Google Page Speed score of 99 I looked at the tips to improve the page speed even further. There are four things that Google considers currently in need of improvement on this page.

    Continue reading

  • Ruby on Rails nil check

    Rails provides a great way to check for nil and empty variables in the same call: blank?. This is especially helpful in ERB templates where a variable can be either nil or empty, depending on the object. Without it, the check would look similar to this:

    <% unless obj.nil? and obj != "" %>
        <%= obj %>
    <% end %>
    This is quite cumbersome and easy to forget. With blank?, this can be simplified to:
    <% unless obj.blank? %>
        <%= obj %>
    <% end %>
    For the following values blank? returns true and false respectively:
    => true
    => true
    => false
    => false
    => false

  • Jekyll JSONFeed installed

    I finally followed through with my plan from 2017 to install JSONFeed for this blog. Valid feed validated on Although I haven’t seen any breakthrough of this as a technology, I’ll keep it running next to the XML feed and will monitor all requests. This feed is compliant to the standard. To get it to work, I had to adjust my template a little bit and also use jsonify from the liquid template language. Overall, it was easier to get an XML feed to work as JSON is very picky about escaping of double quotes and other special HTML characters. My template for Jekyll is saved as feed.json and looks as follows:

    layout: null
        "version": "",
        "title": {{ site.title | jsonify }},
        "description": {{ site.description | strip_newlines | jsonify }},
        "language": "{{ site.language }}",
        "home_page_url": "{{ site.url }}{{ site.baseurl }}",
        "feed_url": "{{ site.url }}{{ site.baseurl }}/feed.json",
        "items": [
            {% for post in site.posts limit:100 %}
                "id": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
                "url": "{{ post.url | prepend: site.baseurl | prepend: site.url }}",
                "title": {{ post.title | jsonify }},
                "content_html": {{ post.content | strip_newlines | jsonify }},
                "date_published": "{{ | date_to_xmlschema }}"
            }{% unless forloop.last %},{% endunless %}
            {% endfor %}

Page: 16 of 28