From f18ec1bcd6b87354c8a87f748681a4c147245791 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 9 Feb 2019 09:28:58 +0100 Subject: [PATCH] Change base_url --- _templates/layout.html | 1 + conf.py | 2 +- netlify.toml | 4 ++-- seo.py | 3 +-- sitemap.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/_templates/layout.html b/_templates/layout.html index a4b3402ba..d1a0f0cd6 100644 --- a/_templates/layout.html +++ b/_templates/layout.html @@ -15,6 +15,7 @@ + {% endblock %} {% block footer %} diff --git a/conf.py b/conf.py index 59cba22a3..3142f8966 100644 --- a/conf.py +++ b/conf.py @@ -112,7 +112,7 @@ html_theme = 'alabaster' # further. For a list of options available for each theme, see the # documentation. # -html_baseurl = os.getenv('BASE_URL', 'https://esphome.io/') +html_baseurl = os.getenv('BASE_URL', 'https://esphome.io') html_theme_options = { # 'logo': 'logo-full.png', 'logo_name': False, diff --git a/netlify.toml b/netlify.toml index a9859e56b..0a882c40c 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,10 +1,10 @@ [build] publish = "_build/html" command = "make netlify" - environment = { BASE_URL = "https://esphome.io/" } + environment = { BASE_URL = "https://esphome.io" } [context.beta] - environment = { BASE_URL = "https://beta.esphome.io/" } + environment = { BASE_URL = "https://beta.esphome.io" } # A basic redirect rule [[redirects]] diff --git a/seo.py b/seo.py index bc3bc376d..0a7a5ec81 100644 --- a/seo.py +++ b/seo.py @@ -44,7 +44,7 @@ def seo_visit(self: HTMLTranslator, node: SEONode): def create_property_meta(name, content): if content is None: return - self.meta.append('\n'.format(name, encode_text(content))) + self.meta.append('\n'.format(name, encode_text(content))) # Base create_content_meta("description", node.description) @@ -70,7 +70,6 @@ def seo_visit(self: HTMLTranslator, node: SEONode): create_property_meta("og:title", node.title) create_property_meta("og:image", node.image) create_property_meta("og:type", "article" if node.author is not None else "website") - create_property_meta("og:site_name", "ESPHome") create_property_meta("og:description", node.description) diff --git a/sitemap.py b/sitemap.py index 5e613f28a..e84c553e5 100644 --- a/sitemap.py +++ b/sitemap.py @@ -37,7 +37,7 @@ def create_sitemap(app, exception): for link in app.sitemap_links: url = ET.SubElement(root, "url") - ET.SubElement(url, "loc").text = app.builder.config.html_baseurl + link + ET.SubElement(url, "loc").text = app.builder.config.html_baseurl + '/' + link priority = 0.5 if link.endswith('index.html'): priority += 0.25