Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Name the logo after the site
| -rw-r--r-- | source/ui-shared.c | 6 | |
| -rwxr-xr-x | tests/t0005-markup.sh | 7 |
2 files changed, 12 insertions, 1 deletion
diff --git a/source/ui-shared.c b/source/ui-shared.c index c3eee0b..268de57 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -394,7 +394,11 @@ static void print_header(void) html_attr(ctx.cfg.virtual_root); html("'><img src='"); html_attr(logo); - html("' alt='cgit logo'></a>\n"); + // The image is all the link holds, so its text names where the + // link goes, the site's index unless logo-link says otherwise. + html("' alt='"); + html_attr(ctx.cfg.root_title); + html("'></a>\n"); } html("<h1 class='main'>"); diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 3260e49..cf9143b 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -118,6 +118,13 @@ test_expect_success 'each page names itself, then the repository and the site' ' grep "<title>blame - hello.c < dir - hooks - $site</title>" tmp ' +# The logo is all its link holds, so it is named for where the link leads, +# which by default is the site's index. +test_expect_success 'the logo is named after the site' ' + cgit_rc hooksrc "url=hooks/" >tmp && + grep "<a class=.logo. href=./.><img src=./cgit.png. alt=.Git repository browser.></a>" tmp +' + test_expect_success 'an error page names the error where a page names itself' ' site="Git repository browser" && cgit_rc hooksrc "url=hooks/tree/missing" >tmp && |
