Fixed open graph image URL

This commit is contained in:
squidfunk 2020-03-29 15:21:11 +02:00
parent 5be665825e
commit a1bc6f99eb
3 changed files with 5 additions and 4 deletions

View File

@ -7,7 +7,7 @@
{% if page and page.title and not page.is_homepage %}
{% set title = config.site_name ~ " - " ~ page.title | striptags %}
{% endif %}
{% set image = 'assets/images/material.png' | url %}
{% set image = config.site_url ~ 'assets/images/material.png' %}
<meta property="og:title" content="{{ title }}">
<meta property="og:description" content="{{ config.site_description }}">
<meta property="og:url" content="{{ page.canonical_url }}">

View File

@ -22,7 +22,8 @@
site_name: Material for MkDocs
site_description: A Material Design theme for MkDocs
site_author: Martin Donath
site_url: https://squidfunk.github.io/mkdocs-material/
site_url: https://deploy-preview-1486--mkdocs-material-preview.netlify.com/
#site_url: https://squidfunk.github.io/mkdocs-material/
# Repository
repo_name: squidfunk/mkdocs-material

View File

@ -31,8 +31,8 @@
{% set title = config.site_name ~ " - " ~ page.title | striptags %}
{% endif %}
<!-- Determine image -->
{% set image = 'assets/images/material.png' | url %}
<!-- The image needs to have an absolute URL -->
{% set image = config.site_url ~ 'assets/images/material.png' %}
<!-- Open graph meta tags -->
<meta property="og:title" content="{{ title }}" />