[PATCH] add 'go-import' meta tag if in a repo

Derek Stevens nilix at nilfm.cc
Mon May 9 14:57:25 UTC 2022


I've been really busy with life lately so I don't mind if you take it on!

Cheers,
Derek

"Max Resnick" <max_resnick at fastmail.fm> wrote:
> Hi are you going to complete this or would you care if I completed it? 
> 
> Thanks 
> Max
> 
> On Sun, Jan 9, 2022, at 09:45, Derek Stevens wrote:
> > Ok, I'll see about adding a config option and corresponding 
> > documentation for this, as well as make sure that my indentation is 
> > consistent.
> >
> > Thanks!
> > Derek
> >
> > ------original message------
> > From: Jamie Couture <jamie.couture at gmail.com>
> > Date: Sun, Jan 09, 2022 at 09:59:04AM MST
> >
> >> On Sat, Jan 08, 2022 at 04:55:59PM -0700, Derek Stevens wrote:
> >> > Signed-off-by: Derek Stevens <nilix at nilfm.cc>
> >> > ---
> >> > ui-shared.c | 3 +++
> >> > 1 file changed, 3 insertions(+)
> >> > 
> >> > diff --git a/ui-shared.c b/ui-shared.c
> >> > index acd8ab5..0f57af6 100644
> >> > --- a/ui-shared.c
> >> > +++ b/ui-shared.c
> >> > @@ -785,6 +785,9 @@ void cgit_print_docstart(void)
> >> > 	html_txt(ctx.page.title);
> >> > 	html("</title>\n");
> >> > 	htmlf("<meta name='generator' content='cgit %s'/>\n", cgit_version);
> >> > +	if (ctx.repo)
> >> I recommend making this an optional feature people can opt-in and use.  
> >> Consider adding a configuration flag [1] and supporting documentation [2],
> >> allowing admins to turn a knob 'on' if they want to use this feature.
> >> 
> >> As John pointed out a minor nit: the leading whitespace should be tabs, 
> >> whereas these lines are mixed tab-and-space..
> >> 
> >> > +	  htmlf("<meta name='go-import' content='%s%s%s git https://%s%s%s'/>\n",
> >> > +	    host, cgit_rooturl(), ctx.repo->url, host, cgit_rooturl(), ctx.repo->url);
> >> > 	if (ctx.cfg.robots && *ctx.cfg.robots)
> >> > 		htmlf("<meta name='robots' content='%s'/>\n", ctx.cfg.robots);
> >> > 	html("<link rel='stylesheet' type='text/css' href='");
> >> > -- 
> >> > 2.34.1
> >> > 
> >> 
> >> --
> >> 
> >> [1] https://git.zx2c4.com/cgit/tree/cgit.c#n42
> >> [2] https://git.zx2c4.com/cgit/tree/cgitrc.5.txt
> >
> >
> >
> > ----- End forwarded message -----
> >
> > Attachments:
> > * signature.asc




More information about the CGit mailing list