From 7724ec8b295feb8e766b11de02b7d695d88f2fd7 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 09:36:38 -1000 Subject: Test the robots tag on ordinary pages Only the login page's tag was checked, so printing noindex everywhere would have taken every site out of the search engines and passed. --- tests/t0005-markup.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/t0005-markup.sh b/tests/t0005-markup.sh index 3f6b8e7..8251393 100755 --- a/tests/t0005-markup.sh +++ b/tests/t0005-markup.sh @@ -153,6 +153,26 @@ test_expect_success 'an error page names the error where a page names itself' ' grep "Not Found - $site" tmp ' +# A site is indexed but its links not followed unless robots says otherwise, +# and an empty value leaves the choice to the crawler. +test_expect_success 'the pages ask robots what the robots setting says' ' + cgit_ok hooksrc "url=hooks/" >tmp && + test_grep "" tmp && + { + echo "robots=noindex, noarchive" && + cat hooksrc + } >robotsrc && + cgit_ok robotsrc "url=hooks/" >tmp && + test_grep "" tmp && + { + echo "robots=" && + cat hooksrc + } >robotsrc && + cgit_ok robotsrc "url=hooks/" >tmp && + test_grep "