From 2842d3d8cc5e19bde3083d5785f6c40b1c2dbf9d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 18:18:00 -1000 Subject: Say that js may be given more than once --- MANUAL.txt | 6 ++++-- tests/t0101-index.sh | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index e9eb800..e058787 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -313,8 +313,10 @@ include:: js:: Url which specifies the javascript script document to include in all - cgit pages. Default value: "/cgit.js". Setting this to an empty string - will disable generation of the link to this file in the head section. + cgit pages. Default value: "/cgit.js". May be given multiple times, each + script URL path is added in the head section of the document in turn. + Setting this to an empty string will disable generation of the link to + this file in the head section. local-time:: Flag which, if set to "1", makes cgit print commit and tag times in the diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index fce9e99..b2ec813 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -4,7 +4,8 @@ # fixture repository and its description, for the escaping a name with a # plus or a space needs in a link, and for the absence of the tree and log # links that belong to a repository's own pages unless enable-index-links -# asks for them. +# asks for them. The page's head also stands in for every page's, with one +# link per css and js entry. test_description='Check content on index page' . ./setup.sh @@ -28,4 +29,22 @@ test_expect_success 'index links lead to the summary, log and tree' ' grep "href=./foo/log/.>logtree<" tmp ' +test_expect_success 'each css and js entry gets a link of its own' ' + { + echo "css=/a.css" && + echo "css=/b.css" && + echo "js=/a.js" && + echo "js=" && + echo "js=/b.js" + } >headrc && + sed "s/^cache-size=.*/cache-size=0/" cgitrc >>headrc && + CGIT_CONFIG="$PWD/headrc" QUERY_STRING="url=" cgit >tmp && + grep "" tmp && + grep "" tmp && + grep "