From 942615c34af69f4d59ebcd5914ca024b71075238 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sun, 17 Feb 2019 10:32:40 +0100 Subject: [PATCH] Add production var --- netlify.toml | 3 +++ sitemap.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index b4ba3adef..418d43ee0 100644 --- a/netlify.toml +++ b/netlify.toml @@ -9,6 +9,9 @@ [context.next] environment = { BASE_URL = "https://next.esphome.io" } +[context.production] + environment = { BASE_URL = "https://esphome.io", PRODUCTION = "YES" } + # A basic redirect rule [[redirects]] from = "/esphomeyaml/*" diff --git a/sitemap.py b/sitemap.py index b5114323e..44300d961 100644 --- a/sitemap.py +++ b/sitemap.py @@ -39,6 +39,6 @@ def create_sitemap(app, exception): encoding='utf-8', method="xml") - if app.builder.config.html_baseurl != 'https://esphome.io': + if os.getenv('PRODUCTION') != 'YES': with open(os.path.join(app.builder.outdir, 'robots.txt'), 'wt') as f: f.write('User-agent: *\nDisallow: /\n')