From e76e0a6c1957c7762c845c2caae956e45a8a0561 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 28 Apr 2026 22:23:52 +0800 Subject: [PATCH] Add robots.txt and exclude next from sitemap Create static/robots.txt to disallow crawling of the /next preview and old versioned docs and point to the sitemap. Update docusaurus.config.js sitemap settings: set priority and changefreq to null and add "/next/**" to ignorePatterns so preview content is excluded from the generated sitemap. --- docusaurus.config.js | 5 +++-- static/robots.txt | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 static/robots.txt diff --git a/docusaurus.config.js b/docusaurus.config.js index a1d21eb5..537fa4fe 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -79,8 +79,9 @@ const config = { }, sitemap: { changefreq: "weekly", - priority: 0.5, - ignorePatterns: ["/2.18/**", "/2.19/**", "/2.20/**", "/2.21/**", "/2.22/**", "/2.23/**"], + priority: null, + changefreq: null, + ignorePatterns: ["/next/**", "/2.18/**", "/2.19/**", "/2.20/**", "/2.21/**", "/2.22/**", "/2.23/**"], }, googleAnalytics: { trackingID: "UA-110780416-7", diff --git a/static/robots.txt b/static/robots.txt new file mode 100644 index 00000000..1c018061 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,12 @@ +User-agent: * +Allow: / +Disallow: /next +Disallow: /2.18 +Disallow: /2.19 +Disallow: /2.20 +Disallow: /2.21 +Disallow: /2.22 +Disallow: /2.23 + + +Sitemap: https://docs.halo.run/sitemap.xml \ No newline at end of file