aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJohn Keeping2014-08-01 22:14:19 +0100
committerJason A. Donenfeld2014-12-23 19:04:21 -0700
commit3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34 (patch)
tree444a834071c51bcadd5b8c9a2dc7b986f0af94a6 /ui-shared.c
parentd31be4ccc2f978edd2a40c2721e1efdc1eee2343 (diff)
downloadcgit-3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34.tar.gz
cgit-3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34.tar.bz2
cgit-3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34.zip
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)
660 exit(0); 660 exit(0);
661} 661}
662 662
663static void print_rel_vcs_link(const char *url)
664{
665 html("<link rel='vcs-git' href='");
666 html_attr(url);
667 html("' title='");
668 html_attr(ctx.repo->name);
669 html(" Git repository'/>\n");
670}
671
663void cgit_print_docstart(void) 672void cgit_print_docstart(void)
664{ 673{
665 if (ctx.cfg.embedded) { 674 if (ctx.cfg.embedded) {
@@ -698,6 +707,8 @@ void cgit_print_docstart(void)
698 html("' type='application/atom+xml'/>\n"); 707 html("' type='application/atom+xml'/>\n");
699 strbuf_release(&sb); 708 strbuf_release(&sb);
700 } 709 }
710 if (ctx.repo)
711 cgit_add_clone_urls(print_rel_vcs_link);
701 if (ctx.cfg.head_include) 712 if (ctx.cfg.head_include)
702 html_include(ctx.cfg.head_include); 713 html_include(ctx.cfg.head_include);
703 html("</head>\n"); 714 html("</head>\n");