summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-01-14 01:49:44 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-01-14 01:49:44 -0500
commit5e8011e0dadd475fe1cb59c7f1e8f2896e25703f (patch)
treec651d553944b1c88e278d3ebc4047bbfb3fef1c0
parent91153fd02e62f2eaca8e6c140baa4f2abf39c40e (diff)
Add go importpath <meta name=go-import> tagslukeshu/cgit-1.1-goimport-1
-rw-r--r--ui-shared.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 2e4fcd9..d0b98b0 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -755,6 +755,23 @@ void cgit_print_docstart(void)
strbuf_release(&sb);
free(fileurl);
}
+ if (host && ctx.repo) {
+ char *repourl = cgit_repourl(ctx.repo->url);
+ if (repourl[strlen(repourl)-1] == '/') {
+ repourl[strlen(repourl)-1] = '\0';
+ }
+
+ html("<meta name='go-import' content='");
+ html_attr(host);
+ html_attr(repourl);
+ html(" git ");
+ html(cgit_httpscheme());
+ html_attr(host);
+ html_attr(repourl);
+ html("'/>\n");
+
+ free(repourl);
+ }
if (ctx.repo)
cgit_add_clone_urls(print_rel_vcs_link);
if (ctx.cfg.head_include)