List for cgit developers and users
 help / color / mirror / Atom feed
* Reverse Paths in Title
@ 2016-01-18 15:16 Jason
  2016-01-18 15:45 ` john
  0 siblings, 1 reply; 2+ messages in thread
From: Jason @ 2016-01-18 15:16 UTC (permalink / raw)


With lots of tabs open containing many files from /tree, it's useful
to see which file is open. For this I'm reversing the components of
the path name, flipping the slash around, and pre-pending it to the
document title.

http://git.zx2c4.com/linux/tree/arch/x86/boot/copy.S

Take a look at the document <title> on that page.

Comments? Suggestions?

Implemented here:
http://git.zx2c4.com/cgit/commit/?id=23f7dadaaba2817c92c42c0a642a3186aa8ef24d


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Reverse Paths in Title
  2016-01-18 15:16 Reverse Paths in Title Jason
@ 2016-01-18 15:45 ` john
  0 siblings, 0 replies; 2+ messages in thread
From: john @ 2016-01-18 15:45 UTC (permalink / raw)


On Mon, Jan 18, 2016 at 04:16:03PM +0100, Jason A. Donenfeld wrote:
> With lots of tabs open containing many files from /tree, it's useful
> to see which file is open. For this I'm reversing the components of
> the path name, flipping the slash around, and pre-pending it to the
> document title.
> 
> http://git.zx2c4.com/linux/tree/arch/x86/boot/copy.S
> 
> Take a look at the document <title> on that page.

I find the reversed path really confusing when I look at it as a whole,
which makes it harder to find tabs in a list such as the tab dropdown
Firefox presents when you have a lot of tabs.

I was surprised we don't already show the file path in the header, which
I agree is a good idea.

Personally, I'd prefer something like this which has the advantage that
it still leaves the project name at the front of the title.

-- >8 --
diff --git a/cgit.c b/cgit.c
index 28a2f14..6c85465 100644
--- a/cgit.c
+++ b/cgit.c
@@ -586,7 +586,8 @@ static int prepare_repo_cmd(void)
                cgit_print_docend();
                return 1;
        }
-       ctx.page.title = fmtalloc("%s - %s", ctx.repo->name, ctx.repo->desc);
+       ctx.page.title = fmtalloc("%s%s%s - %s", ctx.repo->name,
+                ctx.qry.page ? "/" : "", ctx.qry.page, ctx.repo->desc);
 
        if (!ctx.repo->defbranch)
                ctx.repo->defbranch = guess_defbranch();


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-18 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-18 15:16 Reverse Paths in Title Jason
2016-01-18 15:45 ` john

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).