Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Name the page first in every title
Summary, about, log, refs, tag and stats pages shared one title, so tabs, history and search results could not tell them apart. Titles now read page, repository and site, with root-title as the site, and the description stays in the meta description, where search engines read it.
Diffstat (limited to 'source/ui-shared.c')
-rw-r--r--source/ui-shared.c10
1 file changed, 10 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index e7b7d88..8da9878 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1991,3 +1991,13 @@ void cgit_set_title_from_path(const char *path)
strbuf_addf(&sb, " - %s", ctx.page.title);
ctx.page.title = strbuf_detach(&sb, NULL);
}
+
+/*
+ * Names the page ahead of the repository and the site, so that the pages of one
+ * repository can be told apart in tabs, history and search results.
+ */
+void cgit_prefix_title(const char *name)
+{
+ ctx.page.title = cgit_fmtalloc("%s - %s", name,
+ ctx.page.title ? ctx.page.title : ctx.cfg.root_title);
+}