TL;DR: Here we discuss some CSS style changes,
MathML insertion changes for equation rendering, external link hinting,
some new articles worth checking out, some website statistics and
finally some news about moving the server.
CSS Dark Mode
We now have a dark mode on the website! It’s very basic and simply
implemented in CSS using a media query selector, being the least
intrusive method of implementation I could think of. It uses a query
like so:
By default the theme is light. I’ve seen a few websites use
@media (prefers-color-scheme: light) to reduce elements
being set too many overriding properties - but this doesn’t feel
fail-safe encase the media query is not supported.
As you can see, we only need to override the colours for the dark
mode, and this is only done if the browser supports this. This appears
to be the best fail-safe low-compromise solution to the problem.
By default, this is the view I enjoy in Firefox - personally I find
it better. I’m still slightly adjusting the colours, but they are mostly
there now. I still need to update Dead Social to
also support the dark mode theme.
MathML Insertion
This one is more of a discussion about how the sausage is made, but
now we are only inserting the MathML JS
when we detect that the rendered output requires it. This removes the
need for the 95% of pages that do not include any MathML to require the
JS, which is only required for Chrome, Chromium and Safari users
currently.
In general I am currently of the opinion that MathML is the real
winner of the browser math libraries, and with the one I’m using
weighing in at just 80kB (compare to other much heavier libraries) I’m
pretty happy with the compromise.
Just recently I was glad to have implemented the MathML functionality
when I was discussing
values in an article about the COVID lockdown.
External Link Hinting
NOTE: This is a late addition to this article,
apologies. The idea was too good to not implement!
After reading an article by Hund
and then an article by Christian
Oliff I have decided to also do the same, and use external link
hinting. I used to do this quite some years ago, but I used bitmaps and
it looks like crap.
In order to implement this, I used the following CSS:
It is essentially a clone of Hund’s CSS, except I use Christian’s
data URI to save the browser the additional requests, and therefore
limit re-layout of the document once the image is requested. My
assumption is also that if your browser supports such advanced CSS, then
you will likely support the data URI. For example, it works in Firefox
and Chromium, but not NetSurf or Dillo 1.
At some point it would be good to add a special link for RSS feeds
too… Perhaps in a nice orange colour!
Finally, regarding Hund’s comment:
As for the “dark mode” users, there’s unfortunately no way to
override the black icon with a white icon. I don’t know why it doesn’t
work, but it’s not something I can do about it.
This is relatively easy using the CSS hack I implemented
previously.
Content
I have obviously been uploading quite a bit of content (and continue
to do so as I type). Particularly worth checking out in the recent
articles (in my opinion) are:
Keto diet updates - A
series of updates about my keto diet progress.
COVID lockdown - An
important discussion about misconception about vaccination results.
Chunk boi pro - The start of
creating a custom laptop to replace my current daily driver.
Daily requests are now a little higher, averaging more than
10x more traffic per day. A few changes were made based on my previous
ideas:
SEO optimization - This was mostly about forcing search
engines to check back more regularly for additional content. This turned
out to be the most successful change.
Link preview - This didn’t have so much effect in the end,
but was a worthwhile exercise nevertheless. If the website does gain
some mainstream attention (hopefully positive) at least the website will
be prepared.
It appears that most of these new requests were picked up in the
Netherlands - I have zero idea for why this is the case. I had a look
online and couldn’t find out too much information as to why this is the
case.
Other than that, views from Germany and the US seem to be quite high
also. Bare in mind that I probably generate the majority of the traffic
from New Zealand, there is an awful lot of traffic coming from other
locations that is not generated by myself.
Looking at a random sample of the Nginx logs (filtered), a lot of the
traffic consists of bots accessing /git/*, which is the
cgit server. Good job I turned on static caching so
heavily, otherwise the server would have melted by now!
Traffic is traffic though - anything that gets search engines looking
at my website is generally good for discoverability.
Moving
This old Scaleway C1 instance (bare metal) has its days numbered now,
despite me still being relatively happy with the service. I’m getting
quite aggressive emails now telling me to move the instance somewhere
else. This is the current timeline:
June 1, 2021: quotas and limitations
As a C1 instance customer, you will be able to keep all your current
C1 instances running, and to create one more new C1 instance. You will
be allowed to start, stop and back up C1 instances, so you can assess
all possible migration scenarios.
As of June 1, Scaleway Elements customers that do not already have C1
instances will not be able to create new ones.
July 1, 2021: end of support
July 1, 2021 will mark the end of support for C1, meaning no more
patches, updates or interventions on software or hardware will be
provided. You will not be able to open new support tickets for C1
instances either.
August 1, 2021: instance creation freeze
Scaleway Elements users will no longer be able to create C1
instances. As a C1 instance customer, your current instances will keep
running. However in case of an instance stopping (planned or unplanned),
you will not be able to restart the instance.
September 1, 2021: end of life
Flexible & dynamic public IPs will be detached from C1 instances
to force a service interruption as a final warning. You will have 24
hours to migrate your instances.
Please note, flexible IPs will still be charged if you do not delete
them.
As it stands, if the server crashes I’m screwed. I either need to
migrate to another of their servers, or find a different one elsewhere.
I am currently looking at different services. I have had a very good
experience so far with ChicagoVPS and could be convinced to migrate my
servers there. $15 per year is pretty competitive and I already have
accounts and servers there, although it’s not nearly as powerful as what
I currently run.