Fixed open graph and Twitter cards documentation

This commit is contained in:
squidfunk 2020-07-30 20:10:16 +02:00
parent 25b2af52c7
commit 623a63101d

View File

@ -85,6 +85,12 @@ tags to the template:
``` html ``` html
{% block extrahead %} {% block extrahead %}
{% set title = config.site_name %}
{% if page and page.meta and page.meta.title %}
{% set title = config.site_name ~ " - " ~ page.meta.title %}
{% elif page and page.title and not page.is_homepage %}
{% set title = config.site_name ~ " - " ~ page.title | striptags %}
{% endif %}
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:title" content="{{ title }}" /> <meta property="og:title" content="{{ title }}" />
<meta property="og:description" content="{{ config.site_description }}" /> <meta property="og:description" content="{{ config.site_description }}" />
@ -107,6 +113,12 @@ of your site:
``` html ``` html
{% block extrahead %} {% block extrahead %}
{% set title = config.site_name %}
{% if page and page.meta and page.meta.title %}
{% set title = config.site_name ~ " - " ~ page.meta.title %}
{% elif page and page.title and not page.is_homepage %}
{% set title = config.site_name ~ " - " ~ page.title | striptags %}
{% endif %}
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="<username>" /> <meta name="twitter:site" content="<username>" />
<meta name="twitter:creator" content="<username>" /> <meta name="twitter:creator" content="<username>" />