Add source page

We are about to introduce rendering of content for the tree view.  This
source page will allow bypassing the renderer and accessing the content
of the current tree view.

Signed-off-by: John Keeping <john@keeping.me.uk>
diff --git a/ui-shared.c b/ui-shared.c
index 24fa9f7..15887cc 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -312,6 +312,12 @@
 	reporevlink("tree", name, title, class, head, rev, path);
 }
 
+void cgit_source_link(const char *name, const char *title, const char *class,
+		    const char *head, const char *rev, const char *path)
+{
+	reporevlink("source", name, title, class, head, rev, path);
+}
+
 void cgit_plain_link(const char *name, const char *title, const char *class,
 		     const char *head, const char *rev, const char *path)
 {
@@ -494,6 +500,10 @@
 		cgit_tree_link(name, title, class, ctx.qry.head,
 			       ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
 			       ctx.qry.path);
+	else if (!strcmp(ctx.qry.page, "source"))
+		cgit_source_link(name, title, class, ctx.qry.head,
+				 ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
+				 ctx.qry.path);
 	else if (!strcmp(ctx.qry.page, "plain"))
 		cgit_plain_link(name, title, class, ctx.qry.head,
 				ctx.qry.has_sha1 ? ctx.qry.sha1 : NULL,
@@ -1008,6 +1018,10 @@
 		if (ctx.qry.page && !strcmp(ctx.qry.page, "blame"))
 			cgit_blame_link("blame", NULL, hc("blame"), ctx.qry.head,
 				        ctx.qry.sha1, ctx.qry.vpath);
+		else if (ctx.qry.page && !strcmp(ctx.qry.page, "source"))
+			cgit_source_link("tree", NULL, hc("source"),
+					 ctx.qry.head, ctx.qry.sha1,
+					 ctx.qry.vpath);
 		else
 			cgit_tree_link("tree", NULL, hc("tree"), ctx.qry.head,
 				       ctx.qry.sha1, ctx.qry.vpath);