Skip to content

Commit c890e01

Browse files
authored
Fix order in robots.txt preventing indexation of images by Google (#3617)
1 parent 659be55 commit c890e01

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/pink-turtles-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Fix order in robots.txt preventing indexation of images by Google.

packages/gitbook/src/routes/robots.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ export async function serveRobotsTxt(context: GitBookSiteContext) {
1313
const lines = isIndexable
1414
? [
1515
'User-agent: *',
16+
// Disallow other dynamic routes / search queries
17+
'Disallow: /*?',
1618
// Allow image resizing and icon generation routes for favicons and search results
1719
'Allow: /~gitbook/image?*',
1820
'Allow: /~gitbook/icon?*',
19-
// Disallow other dynamic routes / search queries
20-
'Disallow: /*?',
2121
'Allow: /',
2222
`Sitemap: ${linker.toAbsoluteURL(linker.toPathInSpace(isRoot ? '/sitemap.xml' : '/sitemap-pages.xml'))}`,
2323
]

0 commit comments

Comments
 (0)