nethunters.xyz/templates/macros/social.html

47 lines
1.5 KiB
HTML
Raw Normal View History

{% macro og_preview() %}
<meta property="og:title" content="{{ social::og_title() }}" />
<meta property="og:type" content="website"/>
{%- if current_url -%}
<meta property="og:url" content="{{ current_url }}"/>
{%- endif -%}
<meta property="og:description" content="{{ social::og_description() }}"/>
{%- if config.extra.og_preview_img -%}
<meta property="og:image" content="{{ get_url(path=config.extra.og_preview_img) }}"/>
{%- endif -%}
{% endmacro og_preview %}
{% macro og_description() %}
{%- if section -%}
{%- if section.description -%}
{{ section.description }}
{%- else -%}
{{ config.description }}
{%- endif -%}
{%- elif page -%}
{%- if page.summary | string -%}
{{ page.summary | striptags | truncate(length=200) }}
{%- elif page.description -%}
{{ page.description }}
{%- else -%}
{{ config.description }}
{%- endif -%}
{%- endif -%}
{% endmacro og_description %}
{% macro og_title() -%}
{{ config.title }} -&nbsp;
{%- if section -%}
{%- if section.title -%}
{{ section.title | striptags }}
{%- else -%}
{{ config.description }}
{%- endif -%}
{%- elif page -%}
{%- if page.title -%}
{{ page.title | striptags }}
{%- else -%}
{{ config.description }}
{%- endif -%}
{%- endif -%}
{% endmacro og_title %}