all repos — cgit @ 3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34

a hyperfast web frontend for git written in c

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>
John Keeping john@keeping.me.uk
Fri, 01 Aug 2014 22:14:19 +0100
commit

3c53ebfb57a5dba8fc65b2f99ebbfb6356666e34

parent

d31be4ccc2f978edd2a40c2721e1efdc1eee2343

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -660,6 +660,15 @@ if (ctx.env.request_method && !strcmp(ctx.env.request_method, "HEAD"))

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 @@ sb.buf));

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");