Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pink-turtles-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Fix order in robots.txt preventing indexation of images by Google.
4 changes: 2 additions & 2 deletions packages/gitbook/src/routes/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))}`,
]
Expand Down