We have two with ... as ... etc statement for reading and writing files.
In addition, the names of the content yaml file and the locate for the rendered html are hard-coded.
Instead, use parameters like DOCS_DIR, which is set at the top of build.py, those possibly in a .config, though that might be an overkill or even make things more complicated.
The function to write the rendered webpages, should use the href generated as per previous issue about default values of href, instead of again recreating the default value.
And we should probably use os.path.join instead of string concatenation for creating the path to the html file.