Making this website a bit more W3C standards-compliant

| Comment

I spent some hours today to make the HTML and the CSS of this website validate with W3C’s checker.
I probably should send patches to the theme developers, but they don’t make it easier by developing exclusively on GitHub and not hosting a mailing list. The CSS code is linked in the footer of the page though, in compliance with its GPLv2 license.

Fixes (just those are enough to make the website valid):

  • Removed line-height from the CSS
  • Removed mentions of “vendor extensions” from the CSS
  • Replaced the timestamp format in the Jinja HTML template, from {{ article.date.isoformat }} to {{ article.date|strftime("%Y-%m-%dT%H:%M") }}

Further improvements I will implement as soon as possible:

  • Replace any hard-coded font sizes (in points) with relative sizes (ems)
  • Give different sizes to different header levels
  • The Atom feed is missing an <updated> tag for each entry (will need to find out how Pelican generates its feeds)

And then there’s some things the W3C checkers suggests that I am not fully convinced about:

  • Make the website reflow depending on screen size
  • Start each <article> with a <h1> header

The latter makes semantic sense (that’s an interesting phrase) but it’s only a Warning in the checker, and it would clutter the page. I will consider it though. Now, responsive design is not really a priority for me. For one, the point of the theme I’m using is that it is monospaced and fixed at 80 columns per line, which is also how I wrap my emails. For another, this website already renders amazing on text-based browsers and when CSS is disabled on graphical browsers. So someone reading this on mobile is encouraged to simply turn of the CSS. I think I don’t want to bother with reflowing text at the moment.


Category: Website

Tags: HTML, CSS, W3C, Standards