diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2017-01-14 01:49:44 -0500 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-07-06 19:55:50 -0600 |
commit | 4caf25a8c7834568ece454e179d8bd5835a51634 (patch) | |
tree | 93529551015894f9c7b4c72ad7127fb0e6996fd2 /ui-shared.c | |
parent | 55fa25adb097d2681607d8b0f51a0c393cc9af1a (diff) |
Add go importpath <meta name=go-import> tagslukeshu/cgit-1.2.3-goimport-1
Diffstat (limited to 'ui-shared.c')
-rw-r--r-- | ui-shared.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c index d2358f2..ae2dea2 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -809,6 +809,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) |