git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitweb: configurable width for the projects list Description column

From
Michael Hendricks <michael@ndrix.org>
Date
Jul 5, 2007, 00:36 UTC
Message-ID
<11835958082458-git-send-email-michael@ndrix.org>

This allows gitweb users to set $projects_list_description_width in their gitweb.conf to determine how many characters of a project description are displayed before being truncated with an ellipsis.

Signed-off-by: Michael Hendricks <michael@ndrix.org>
---
 gitweb/gitweb.perl |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index dbfb044..29d058c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -71,6 +71,9 @@ our $logo_label = "git homepage";
 # source of projects list
 our $projects_list = "++GITWEB_LIST++";
 
+# the width (in characters) of the projects list "Description" column
+our $projects_list_description_width = 25;
+
 # default order of projects list
 # valid values are none, project, descr, owner, and age
 our $default_projects_order = "project";
@@ -3163,7 +3166,7 @@ sub git_project_list_body {
 		if (!defined $pr->{'descr'}) {
 			my $descr = git_get_project_description($pr->{'path'}) || "";
 			$pr->{'descr_long'} = to_utf8($descr);
-			$pr->{'descr'} = chop_str($descr, 25, 5);
+			$pr->{'descr'} = chop_str($descr, $projects_list_description_width, 5);
 		}
 		if (!defined $pr->{'owner'}) {
 			$pr->{'owner'} = get_file_owner("$projectroot/$pr->{'path'}") || "";
-- 
1.5.3.rc0.14.gebe8f
Next: Jakub Narebski
Message 1 of 2 in “gitweb: configurable width for the projects list Description column”
  1. gitweb: configurable width for the projects list Description columnMichael Hendricks, Jul 5, 2007
  2. Jakub NarebskiJul 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.