X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/98abe5bb9e6297a5dcbae206e00352c8630d922e..b31e99887b17f513289fb11227b2484504e85b6c:/ui-shared.c diff --git a/ui-shared.c b/ui-shared.c index 9d8f66b..a63dcb0 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -10,6 +10,7 @@ #include "ui-shared.h" #include "cmd.h" #include "html.h" +#include "version.h" static const char cgit_doctype[] = "\n"; @@ -151,6 +152,14 @@ const char *cgit_repobasename(const char *reponame) return rvbuf; } +const char *cgit_snapshot_prefix(const struct cgit_repo *repo) +{ + if (repo->snapshot_prefix) + return repo->snapshot_prefix; + + return cgit_repobasename(repo->url); +} + static void site_url(const char *page, const char *search, const char *sort, int ofs, int always_root) { char *delim = "?"; @@ -545,7 +554,7 @@ void cgit_object_link(struct object *obj) page = "tag"; else page = "blob"; - name = fmt("%s %s...", typename(obj->type), shortrev); + name = fmt("%s %s...", type_name(obj->type), shortrev); reporevlink(page, name, NULL, NULL, ctx.qry.head, fullrev, NULL); } @@ -785,8 +794,8 @@ void cgit_print_docend(void) if (ctx.cfg.footer) html_include(ctx.cfg.footer); else { - htmlf("