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/late-teachers-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Disallow crawling by web-robots of search/ask URLs
3 changes: 3 additions & 0 deletions packages/gitbook/src/routes/robots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ export async function serveRobotsTxt(context: GitBookSiteContext) {
const isRoot = checkIsRootSiteContext(context);
const lines = [
'User-agent: *',
// Disallow image resizing
'Disallow: /~gitbook/',
// Disallow dynamic routes / search queries
'Disallow: /*?',
...((await isSiteIndexable(context))
? [
'Allow: /',
Expand Down