git-read

Extract SVG images

Several affordances throughout the application are visualized through <svg> elements. Prior to this commit, they were declared directly in the template HTML.

Some of the application’s iconography was shared across several parts of the interface. For instance, the commit history’s <summary> element in mobile dimensions shared the same icon <svg> elements as the file diff’s <summary> element.

To re-use the shared elements, this commit adds a dependency on the middleman-inline_svg gem, which reads files from the source/images directory and renders the contents of files inline as HTML, similar to what was done before.

The main value that middleman-inline_svg provides is that it affords an opportunity for the rendering context to insert HTML attributes (like class and role) or an SVG <title> element.

To that end, this commit also configures the extension to specify role="img" for each SVG, since each collection of elements represents a single entity.