Change base_url

This commit is contained in:
Otto Winter 2019-02-09 09:28:58 +01:00
parent 387b99aef1
commit f18ec1bcd6
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
5 changed files with 6 additions and 6 deletions

View File

@ -15,6 +15,7 @@
<meta name="theme-color" content="#dfdfdf"> <meta name="theme-color" content="#dfdfdf">
<meta name="HandheldFriendly" content="True"> <meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320"> <meta name="MobileOptimized" content="320">
<meta property="og:site_name" content="ESPHome">
{% endblock %} {% endblock %}
{% block footer %} {% block footer %}

View File

@ -112,7 +112,7 @@ html_theme = 'alabaster'
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
# documentation. # documentation.
# #
html_baseurl = os.getenv('BASE_URL', 'https://esphome.io/') html_baseurl = os.getenv('BASE_URL', 'https://esphome.io')
html_theme_options = { html_theme_options = {
# 'logo': 'logo-full.png', # 'logo': 'logo-full.png',
'logo_name': False, 'logo_name': False,

View File

@ -1,10 +1,10 @@
[build] [build]
publish = "_build/html" publish = "_build/html"
command = "make netlify" command = "make netlify"
environment = { BASE_URL = "https://esphome.io/" } environment = { BASE_URL = "https://esphome.io" }
[context.beta] [context.beta]
environment = { BASE_URL = "https://beta.esphome.io/" } environment = { BASE_URL = "https://beta.esphome.io" }
# A basic redirect rule # A basic redirect rule
[[redirects]] [[redirects]]

3
seo.py
View File

@ -44,7 +44,7 @@ def seo_visit(self: HTMLTranslator, node: SEONode):
def create_property_meta(name, content): def create_property_meta(name, content):
if content is None: if content is None:
return return
self.meta.append('<meta property="{}" content="{}"/>\n'.format(name, encode_text(content))) self.meta.append('<meta property="{}" content="{}">\n'.format(name, encode_text(content)))
# Base # Base
create_content_meta("description", node.description) 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:title", node.title)
create_property_meta("og:image", node.image) 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:type", "article" if node.author is not None else "website")
create_property_meta("og:site_name", "ESPHome")
create_property_meta("og:description", node.description) create_property_meta("og:description", node.description)

View File

@ -37,7 +37,7 @@ def create_sitemap(app, exception):
for link in app.sitemap_links: for link in app.sitemap_links:
url = ET.SubElement(root, "url") 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 priority = 0.5
if link.endswith('index.html'): if link.endswith('index.html'):
priority += 0.25 priority += 0.25