git-read

Dynamically determine project title

Prior to this commit, the application’s page title was hard-coded to be git-read.

For consumer projects, that title won’t apply. In order to determine the value to render as the title, invoke Pathname#basename, which delegates to File.basename to determine the name of the working directory that the Git repository exists in.

Once that value is determined, make it available as part of the history Hash declared as a template-local variable.

To ensure that an operating system’s path quirks don’t result in invalid HTML, wrap the project name with a call to escape_html.