Build Websites with Hugo: Code will not run in a working Hugo setup

I have tracked down this problem thanks to a post by Derek A. Bentley on amazon.com about the book “Build Websites with Hugo” by Brian P Hogan
Throughout the provided code you will find the following comment by the publishers:
(!–
! Excerpted from “Build Websites with Hugo”,
! published by The Pragmatic Bookshelf.
! Copyrights apply to this code. It may not be used to create training material,
! courses, books, articles, and the like. Contact us if you are in doubt.
! We make no guarantees that this code is fit for any purpose.
! Visit http://www.pragmaticprogrammer.com/titles/bhhugo for more book information.
–)
NB replace the ( and ) at the beginning and end with angle brackets < >. I removed them otherwise the code does not show.
For some of the code to run this comment must be removed. I found that the whole comment had to be replaced with a blank like. If the comment is left in place many of the files will run but produce no output and there seem to be no error messages generated. I would suggest removing all these comments with a search and replace.
In the first chapter I found about 10 files with the above comment. Throughout all the files provided I ran a search and about 100 .html and .js contain the above comment.

I am concerned that the code has not been tested after the publisher’s copyright comment was added. I think it would be quite hard for a complete beginner to sort out this problem, I guess that this is an errata. There is another website related to this book not forum.devtalk.com that seems to have a long list of errata to this book but I could not see the problem that I identify here included there.