templates/includes/blocks/share.html.twig line 1
{#<?php
$url = urlencode('https://example.org'); // TODO: This URL has to be the current url that should be shared
$title = urlencode('post title'); // TODO: This is the title of the post.
$linkedin_url = sprintf('https://www.linkedin.com/shareArticle?url=%s&title=%s', $url, $title);
$twitter_url = sprintf('https://twitter.com/share?url=%s&text=%s', $url, $title);
$email_url = sprintf('mailto:?to=&body=%s&subject=%s', $url, $title);
?>#}
{% set url = absolute_url(app.request.requesturi) | url_encode %}
{% set title = pageTitle | url_encode %}
{% set linkedinUrl = 'https://www.linkedin.com/shareArticle?url=%s&title=%s' | format(url, title) %}
{% set twitterUrl = 'https://twitter.com/share?url=%s&text=%s' | format(url, title) %}
{% set emailUrl = 'mailto:?to=&body=%s&subject=%s' | format(url, title) %}
<div class="container-small {{ content.top }} {{ content.bottom }}">
{# dump vars #}
{#<div style="font-size: 1.7rem;">
<h2>{{ url }}</h2> <br>
<h2>{{ title }}</h2> <br>
<h2>{{ linkedinUrl }}</h2> <br>
<h2>{{ twitterUrl }}</h2> <br>
<h2>{{ emailUrl }}</h2><br>
<h2>{{ pageTitle }}</h2>
</div>#}
<div class="share">
<a href="{{ linkedinUrl }}" class="button button--pink button--size-secondary button--icon"
target="_blank" rel="noopener noreferrer">
<span class="button__inner">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M22.223 0H1.772C.792 0 0 .773 0 1.73v20.536C0 23.222.792 24 1.772 24h20.451c.98 0 1.777-.778 1.777-1.73V1.73C24 .773 23.203 0 22.223 0ZM7.12 20.452H3.558V8.995H7.12v11.457ZM5.34 7.434a2.064 2.064 0 1 1 0-4.125 2.063 2.063 0 0 1 0 4.125Zm15.112 13.018h-3.558v-5.57c0-1.326-.024-3.037-1.852-3.037-1.851 0-2.133 1.449-2.133 2.944v5.663H9.356V8.995h3.413v1.566h.047c.473-.9 1.636-1.852 3.365-1.852 3.605 0 4.27 2.372 4.27 5.457v6.286Z" fill="currentColor" />
</svg>
</span>
</a>
<a href="{{ twitterUrl }}" class="button button--pink button--size-secondary button--icon"
target="_blank" rel="noopener noreferrer">
<span class="button__inner">
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 20">
<path d="M7.533 19.857A13.93 13.93 0 0 1 0 17.659c1.847.12 5.107-.166 7.135-2.1-3.05-.14-4.426-2.48-4.606-3.48.26.1 1.496.22 2.193-.06C1.214 11.14.675 8.062.795 7.122c.658.46 1.774.62 2.213.58C-.262 5.36.915 1.843 1.493 1.083c2.346 3.25 5.862 5.076 10.213 5.178a5.024 5.024 0 0 1-.126-1.12A4.992 4.992 0 0 1 16.564.143c1.438 0 2.734.611 3.644 1.588.96-.225 2.407-.752 3.114-1.208-.356 1.28-1.466 2.347-2.137 2.743.006.013-.005-.014 0 0 .59-.09 2.185-.396 2.815-.824-.312.72-1.488 1.915-2.453 2.584.18 7.921-5.881 14.831-14.014 14.831Z" fill="currentColor" />
</svg>
</span>
</a>
<a href="{{ emailUrl }}" class="button button--pink button--size-secondary button--icon" target="_blank" rel="noopener noreferrer">
<span class="button__inner">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill="currentColor" d="m20 8-8 5-8-5V6l8 5 8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Z" />
</svg>
</span>
</a>
</div>
</div>