Earth Notes: On Website Technicals (2018/12)

Tech updates: feeds and buttons, IMG useful beyond AMP, CMS, test cases, random rebuild order, speakable structured data...

This month I introduced some early 'speakable' structured data support to the site, even though it will not get used for a while, if at all!

2018/12/15: Speakable Markup

Though it's unlikely to be used any time soon (ie probably only for US-originated Google News searches for now), I'm starting to fold in some support for the 'pending' 'speakable'.

I was partly spurred on by the relevant parts of the discussion in What to Expect in 2019 with Google's John Mueller.

This may in future help screen readers and voice searches. Being another site providing this data may in a tiny way speed its adoption.

Google's documentation has this firmly marked as BETA for now.

Note that Google's docs say not to use both xpath and cssSelector, but I am picking out title and description with the former and an optional intro para with the latter. I have split the structured microdata for the latter into its own itemscope and Google's Structured Data Testing Tool seems OK with that, showing the implied value for each item correctly.

All the new meta/structured data is at the very end of the document, so not in the CRP (Critical Rendering Path). Hurrah!

2018/12/09: Random Page Build Order

At times there may be more than one make running to try to rebuild EOU. For example, while the battery charge is high a make -k all may be run every hour.

In particular, the rebuild of each page has a lock around it. Two or more make processes may end up continually trying to make the same page next, with one of them being excluded by the lock after a timeout, and moving on. The multiple processes tend to stay in lockstep, and all that lock contention wastes time and reduces parallelism.

In general make tries to be reasonably dependable and consistent, and shaking that up is hard. A reasonable solution for my gmake on *nx is, given my list of main pages in a "simply expanded variable" PAGES:

PAGES := pageA.html pageB.html ... another.html

... and given that each page's build is independent of the others, then adding this line afterwards mixes things up:

PAGES := $(shell echo $(PAGES) | xargs -n1 | sort -R | xargs)

This works fine with independent make runs with ot without -j to add paralllelism.

The cost is a the execution of the shell command once per make invokation.

2018/12/07: IMG Test Cases

It's a day off for me today, so of course what I do before breakfast is add a couple of tricky unit test cases for IMG!

Let joy be unconfined!

I'm modifiying IMG to be able to accept as src a (standard) thumbnail URL in my 'CMS', at least for body images in the first instance.

This means that I need not copy, minify and check-in to the VCS body images for EOU if they are already being hosted in the Gallery.

(This also means that the IMG tag remains valid HTML if not translated, even if it will be non-optimal in a number of ways.)

The appropriately scaled images will still be served from directly under /img/a/ rather than by the Gallery, and clicking the image will take the visitor through to the Gallery catalogue page.

solar PV grid tie roof mounted power system on slate roof on outbuilding shed garage 1 DHD

Which means that I can drop almost any still raster image in, on whim!

2018/12/02: IMG Helps

The IMG tag is helping me to spruce up existing pages, eg in adding new images to them. Even if I never take AMP pages live, the mechanism is useful. It helps to only need src and class attributes. It is proving helpful to be able to manually set alt sometimes.

So, for example, On Greening Christmas had its rather poor lone image improved and a new one added, and that second image was also added to Low Carbon Family Holidays. I automatically get smaller lower-weight versions for the mobile pages, along with really-low-weight Save-Data versions, and a link back to the source image if too large to be used directly, so possibly containing other information of interest to the visitor. What's not to like?

2018/12/01: Atom Feeds

I freed up a little space on the CRP (Critical Rendering Path) for the home pages (desktop and mobile) and so inserted a header link to the basic Atom site feed. My Firefox "Brief" plugin picks that up and shows a feed button in the URL bar, and I'm hoping that other browsers give similar signals.

Soon I shall drop both the RSS/Atom and G+ 'social media' buttons for each page, and so keeping the feed on the home page in this way may be useful.