From e9baf5b2b02364084b52374917fc3db61357ac42 Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 13 Sep 2024 15:24:18 -0400 Subject: [PATCH 1/3] add new setting for enabling noindex --- app.json | 4 ++++ main/settings.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app.json b/app.json index 52b749d30b..fa40538047 100644 --- a/app.json +++ b/app.json @@ -352,6 +352,10 @@ "description": "Shared secret for JWT auth tokens", "required": false }, + "MITOL_NOINDEX": { + "description": "Prevent search engines from indexing the site", + "required": false + }, "MITOL_SECURE_SSL_REDIRECT": { "description": "Application-level SSL redirect setting.", "value": "True", diff --git a/main/settings.py b/main/settings.py index 340de4f3fa..4d80a00c06 100644 --- a/main/settings.py +++ b/main/settings.py @@ -763,3 +763,6 @@ def get_all_config_keys(): name="POSTHOG_PROJECT_ID", default=None, ) + +# Enable or disable search engine indexing +MITOL_NOINDEX = get_bool("MITOL_NOINDEX", False) # noqa: FBT003 From 5be3379af376f82611a3d78718459c1092663ad8 Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 13 Sep 2024 15:27:40 -0400 Subject: [PATCH 2/3] default to true --- main/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/settings.py b/main/settings.py index 4d80a00c06..7fc95c8513 100644 --- a/main/settings.py +++ b/main/settings.py @@ -765,4 +765,4 @@ def get_all_config_keys(): ) # Enable or disable search engine indexing -MITOL_NOINDEX = get_bool("MITOL_NOINDEX", False) # noqa: FBT003 +MITOL_NOINDEX = get_bool("MITOL_NOINDEX", True) # noqa: FBT003 From 6f1db005b7d63134f46d88ba98d524d5d3afc270 Mon Sep 17 00:00:00 2001 From: Carey Gumaer Date: Fri, 13 Sep 2024 15:39:50 -0400 Subject: [PATCH 3/3] add the setting to the frontend and write in noindex meta tag if it's true --- frontends/mit-learn/public/index.html | 3 +++ frontends/mit-learn/webpack.config.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/frontends/mit-learn/public/index.html b/frontends/mit-learn/public/index.html index 3a53a522fa..db71cb559f 100644 --- a/frontends/mit-learn/public/index.html +++ b/frontends/mit-learn/public/index.html @@ -3,6 +3,9 @@ + <% if (MITOL_NOINDEX) { %> + + <% } %>