-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DorsetDigital/dev-env
Add operation via environment variable
- Loading branch information
Showing
3 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
Block site from being indexed when site is en dev or test mode. | ||
Shows a warning in the CMS. | ||
This module adds a robots metatag to discourage well-behaved search engine spiders from crawling and indexing your site. | ||
|
||
###### Installation | ||
Install via composer: `composer require nobrainerweb/silverstripe-robots-noindex` | ||
|
||
Don't forget to run a `dev/build?flush` | ||
|
||
|
||
|
||
The module will automatically add the tag when your site is in dev or test mode. It can also be activated regardless of the site mode with the addition of an environment variable called 'SEO_PREVENT_INDEXING' which can be set to true. | ||
|
||
For example, if you are using a .env file, you would add the following line to enable the module: | ||
|
||
`SEO_PREVENT_INDEXING = true` | ||
|
||
A warning is shown in the CMS when the module is active and indexing is discouraged. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
en: | ||
NobrainerWeb\NoIndex\NoIndexExtension: | ||
NO_INDEX_WARNING: 'Warning: No indexing! This website is running in development mode, and is not being indexed by search engines' | ||
NO_INDEX_WARNING: 'Warning: No indexing!' | ||
NO_INDEX_WARNING_DEV: 'This website is running in development mode, and is not being indexed by search engines' | ||
NO_INDEX_WARNING_TEST: 'This website is running in test mode, and is not being indexed by search engines' | ||
NO_INDEX_WARNING_ENV: 'Search engine indexing is disabled by an environment setting' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters