From 768ed88978c25916ef84e3bd40058853f6139ff1 Mon Sep 17 00:00:00 2001 From: Ricky Vetter Date: Wed, 18 Oct 2017 11:35:30 -0700 Subject: [PATCH] Add option to avoid indexing site (#142) --- docs/api-site-config.md | 3 +++ lib/core/Head.js | 2 +- website/siteConfig.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api-site-config.md b/docs/api-site-config.md index 733d5f1767..e19e5f3517 100644 --- a/docs/api-site-config.md +++ b/docs/api-site-config.md @@ -27,6 +27,8 @@ The `siteConfig` object contains the bulk of the configuration settings for your `projectName` - Project name. This must match your GitHub repo project name (case sensitive). +`noIndex` - Boolean. If true, Docusaurus will politely ask crawlers and search engines to avoid indexing your site. This is done with a header tag and so only applies to docs and pages. Will not attempt to hide static resources. This is a best effort request. Malicious crawlers can and will still index your site. + `headerLinks` - Links that will be used in the header navigation bar. The `label` field of each object will be the link text and will also be translated for each language. Example Usage: @@ -104,6 +106,7 @@ const siteConfig = { baseUrl: "/test-site/", // baseUrl: "/", projectName: "docusaurus", + noIndex: false, headerLinks: [ { doc: "doc1", label: "Docs" }, { page: "help", label: "Help" }, diff --git a/lib/core/Head.js b/lib/core/Head.js index 805998cd82..030253a2e2 100644 --- a/lib/core/Head.js +++ b/lib/core/Head.js @@ -29,7 +29,7 @@ class Head extends React.Component { - + {this.props.config.noIndex && } {this.props.config.ogImage && (