Fix order in robots.txt preventing indexation of images by Google (#3617)

This commit is contained in:
Samy Pessé
2025-09-01 13:21:11 +02:00
committed by GitHub
parent 659be551bb
commit c890e01004
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"gitbook": patch
---
Fix order in robots.txt preventing indexation of images by Google.
+2 -2
View File
@@ -13,11 +13,11 @@ export async function serveRobotsTxt(context: GitBookSiteContext) {
const lines = isIndexable
? [
'User-agent: *',
// Disallow other dynamic routes / search queries
'Disallow: /*?',
// Allow image resizing and icon generation routes for favicons and search results
'Allow: /~gitbook/image?*',
'Allow: /~gitbook/icon?*',
// Disallow other dynamic routes / search queries
'Disallow: /*?',
'Allow: /',
`Sitemap: ${linker.toAbsoluteURL(linker.toPathInSpace(isRoot ? '/sitemap.xml' : '/sitemap-pages.xml'))}`,
]