aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2014-08-01 23:14:19 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2014-12-24 03:04:21 +0100
commit3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34 (patch)
tree444a834071c51bcadd5b8c9a2dc7b986f0af94a6 /ui-shared.c
parentd31be4ccc2f978edd2a40c2721e1efdc1eee2343 (diff)
downloadcgit-3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34.tar.gz
cgit-3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34.tar.xz
ui-shared: add rel-vcs microformat links to HTML header
As described at https://joeyh.name/rfc/rel-vcs/. Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 4e317d0..cd97ffb 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -660,6 +660,15 @@ void cgit_print_http_headers(void)
exit(0);
}
+static void print_rel_vcs_link(const char *url)
+{
+ html("<link rel='vcs-git' href='");
+ html_attr(url);
+ html("' title='");
+ html_attr(ctx.repo->name);
+ html(" Git repository'/>\n");
+}
+
void cgit_print_docstart(void)
{
if (ctx.cfg.embedded) {
@@ -698,6 +707,8 @@ void cgit_print_docstart(void)
html("' type='application/atom+xml'/>\n");
strbuf_release(&sb);
}
+ if (ctx.repo)
+ cgit_add_clone_urls(print_rel_vcs_link);
if (ctx.cfg.head_include)
html_include(ctx.cfg.head_include);
html("</head>\n");