List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 3/3] ui-shared: add rel-vcs microformat links to HTML header
Date: Fri,  1 Aug 2014 22:14:19 +0100	[thread overview]
Message-ID: <17018368d7bee5be6307f6c628aab5386210fb0d.1406927659.git.john@keeping.me.uk> (raw)
In-Reply-To: <32c0e49ef9eccdcc96d20c2240cd90a7d4062993.1406927659.git.john@keeping.me.uk>

As described at https://joeyh.name/rfc/rel-vcs/.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-shared.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/ui-shared.c b/ui-shared.c
index 5bae02d..9ac65ab 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -661,6 +661,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) {
@@ -699,6 +708,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");
-- 
2.0.3.890.g700db9e



  parent reply	other threads:[~2014-08-01 21:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-01 21:14 [PATCH 1/3] Extract clone URL printing to ui-shared.c john
2014-08-01 21:14 ` [PATCH 2/3] ui-summary: add "rel='vcs-git'" to clone URL links john
2014-08-01 21:14 ` john [this message]
2014-12-24  2:05   ` [PATCH 3/3] ui-shared: add rel-vcs microformat links to HTML header Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17018368d7bee5be6307f6c628aab5386210fb0d.1406927659.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).