Generate card from banner if present. Use page/section description instead of config if available (fixes #51 and #50)
This commit is contained in:
6
templates/partials/card.html
Normal file
6
templates/partials/card.html
Normal file
@ -0,0 +1,6 @@
|
||||
{%- if page.extra.banner -%}
|
||||
{% set card = resize_image(path=page.extra.banner, width=1200, height=628, op="fill") %}
|
||||
{{ card.url }}
|
||||
{%- else -%}
|
||||
{{ get_url(path='card.png') }}
|
||||
{%- endif -%}
|
7
templates/partials/description.html
Normal file
7
templates/partials/description.html
Normal file
@ -0,0 +1,7 @@
|
||||
{%- if page.description -%}
|
||||
{{- page.description }}
|
||||
{%- elif section.description -%}
|
||||
{{- section.description }}
|
||||
{%- else -%}
|
||||
{{- config.description -}}
|
||||
{%- endif -%}
|
@ -123,8 +123,7 @@
|
||||
<meta property="og:site_name" content="{{ config.title }}" />
|
||||
<meta property="og:title" content="{% include 'partials/title.html' %}" />
|
||||
<meta property="og:url" content="{{ current_url | default(value='/') | safe }}" />
|
||||
<meta property="og:description" content="{{ page.description | default(value=config.description) }}" />
|
||||
<meta property="og:image" content="{{ get_url(path='card.png') }}" />
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="og:description" content="{% include 'partials/description.html' %}" />
|
||||
<meta property="og:image" content="{% include 'partials/card.html' %}" />
|
||||
<meta property="og:locale" content="{{ macros_translate::translate(key='date_locale', default='en_US', language_strings=language_strings) }}" />
|
||||
</head>
|
||||
|
Reference in New Issue
Block a user