From 1fc6e3672741441721bc9ec9ffd1ffd3f2c8cf33 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 31 Oct 2026 13:10:49 -0700 Subject: Document virtual-root's default of SCRIPT_NAME cgit falls back to SCRIPT_NAME followed by a slash when virtual-root is unset, so its links always take the path form and none take the ?url= form the docs described. --- MANUAL.txt | 6 +++--- README.txt | 4 ++-- custom/cgitrc | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 4f45d90..10592cd 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -575,9 +575,9 @@ trust-scan-config:: "enable-git-config". virtual-root:: - Url which, if specified, is used as root for all cgit links. cgit then - generates virtual urls such as "/cgit/tree/README" in place of - "?url=cgit/tree/README". Default value: none. + Url used as root for all cgit links, such as "/cgit/" for links like + "/cgit/repo/tree/README". Default value: SCRIPT_NAME followed by a + slash. Repository settings diff --git a/README.txt b/README.txt index 0ef3155..5bc42b4 100644 --- a/README.txt +++ b/README.txt @@ -149,8 +149,8 @@ URLs and query parameters cgit serves every page from one CGI program, so a url names the repository, the page and a path inside that page. There are two forms and they carry the same -information. With virtual-root set, a request is a path, written as -/// with anything else as a query string. Without it, the +information. The one cgit's own links take is a path, written as +/// with anything else as a query string. In the other the whole request lives in the query string as ?url=//. The page name is the second element and is one of about, atom, blame, blob, diff --git a/custom/cgitrc b/custom/cgitrc index 4b4dd4c..23e3072 100644 --- a/custom/cgitrc +++ b/custom/cgitrc @@ -124,8 +124,8 @@ enable-header=1 # or 1. Default is 0. embedded=0 -# Root url for all cgit links, enabling virtual urls. Value is a url path. -# Default is none. +# Root url for all cgit links. Value is a url path. Default is SCRIPT_NAME +# followed by a slash. #virtual-root=/ # Link format string for submodules in directory listings. Value is a format -- cgit