Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions docs/_templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

{%- block extrahead %}
{{ super() }}
<meta property="og:image" content="{{ pathto('_static/images/og-image.png', 1) }}">
{%- if site_baseurl -%}
<meta property="og:image" content="{{ site_baseurl.rstrip('/') }}/{{ pathto('_static/images/og-image.png', 1).lstrip('./') }}">
{%- else -%}
<meta property="og:image" content="{{ pathto('_static/images/og-image.png', 1) }}">
{%- endif -%}
<meta property="og:image:type" content="image/png">
<meta property="og:image:alt" content="Ilustrace organizátora Python akcí">
{%- endblock -%}
{%- endblock -%}
6 changes: 6 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,9 @@
def setup(app):
app.add_css_file("custom.css")
app.add_js_file("redirect.js")

# Make html_baseurl available in templates as site_baseurl
def add_baseurl_to_context(app, pagename, templatename, context, doctree):
context['site_baseurl'] = app.config.html_baseurl

app.connect('html-page-context', add_baseurl_to_context)