The Publishing Project

JSON-LD on the web

JSON-LD is a set of extensions to JSON that allows for creating and exchanging linked data on the web. Perhaps the best-known use of JSON-LD outside semantic web users is using’s JSON-LD structured data for Google’s search engine. The following example gives the structured data snippet to accompany a recipe web page. The example is taken from Understand how structured data works. <html> <head> <title>Party Coffee Cake</title> <script type=”application/ld+json”> { “@context”: “”, “@type”: “Recipe”, “name”: “Party Coffee Cake”, “author”: { “@type”: “Person”, “name”: “Mary Stone” }, “datePublished”: “2018-03-10”, “description”: “This coffee cake is awesome and perfect for parties.”, “prepTime”:

Feature detection and vendor prefixes in CSS

CSS has had to deal with vendor prefixes from very early on and some of those prefixes are still in use today. This post will look at how to use prefixes and how to automate the process, and how to use @supports to test if a feature is supported. Adding CSS prefixes That we’re still dealing with vendor prefixes shows how long some of them have lasted and provides an object lesson on how to handle features in development Developers didn’t think of vendor prefixes as a way to preview features, they shipped them in production, something the CSS Working

Feature detection in Javascript

One thing that makes the web difficult to work with is that a given feature may or may not be available in all your target browsers either because of the version of EcmaScript (the Javascript standard) it was introduced in or because browsers haven’t gotten around to implement them and may not do so at all or worse, they may have poor implementations of a given API (the initial implementation of Indexed DB in Safari comes to mind). In the old days, we would do browser detection and assume that if the browser was Netscape they would support a given

Uninstalling Go on Mac

Homebrew is good but it introduces some complexity to your development, particularly if you’ve installed tools manually before they were available via Homebrew. One of the really problematic tools to move to Homebrew was Go. Because it is installed as a package, removing it is not trivial and may require a lot of manual work after the removal is complete. Run the following command in a terminal to see if Go was installed using the macOS package pkgutil –pkgs Go macOS package is presented as com.googlecode.go in the result list. macOS package stores files in the predefined location. For Go

New CSS selectors: :is and :where

A pair of new pseudo-class selectors have made it easier to write CSS in a way that is easier to read and to reason through. :is and :where allow you to combine selectors that have the same styles. For example, to identify the headers inside an article you’d normally do this: article, h1, article, h2, article, h3, article, h4, article, h5, article, h6 { background: black; color: white; } Instead, you could use :is and improve legibility while avoiding a long selector and potential typos associated with it: article :is(h1, h2, h3, h4, h5, h6) { background: black; color: white;