|
2 | 2 |
|
3 | 3 | {% capture post_body %} |
4 | 4 | {% if site.social_media %} |
5 | | - <div class="col-sm-4 col-lg-3 d-flex flex-wrap flex-items-center d-sm-block float-sm-right border rounded-2 bg-white p-3 mb-5 ml-md-5"> |
6 | | - <h3 class="text-gray-dark mr-3 mr-sm-0">Share</h3> |
7 | | - <ul class="d-flex d-sm-block list-style-none"> |
8 | | - {% for account in site.social_media %} |
9 | | - <li class="mt-sm-3"> |
10 | | - {% assign service_shortname = account[0] %} |
11 | | - {% assign service = site.data.social_media[service_shortname] %} |
12 | | - <a href="{% include social_media_share_url.html service=service_shortname title=page.title permalink=page.url %}" title="Share on {{ service.name }}" class="d-flex flex-items-center"> |
13 | | - <div style="width:32px">{{ service.icon_svg }}</div><span class="d-none d-sm-inline-block text-gray-light">{{ service.name }}</span> |
14 | | - </a> |
15 | | - </li> |
16 | | - {% endfor %} |
17 | | - </ul> |
18 | | - </div> |
| 5 | + {% assign shareable_social_media = '' | split: ',' %} |
| 6 | + |
| 7 | + {% for service in site.social_media %} |
| 8 | + {% if service.share_url %} |
| 9 | + {% assign shareable_social_media = shareable_social_media | push: service %} |
| 10 | + {% end %} |
| 11 | + {% endfor %} |
| 12 | + |
| 13 | + {% assign total_shareable_services = shareable_social_media | size %} |
| 14 | + |
| 15 | + {% if total_shareable_services > 0 %} |
| 16 | + <div class="col-sm-4 col-lg-3 d-flex flex-wrap flex-items-center d-sm-block float-sm-right border rounded-2 bg-white p-3 mb-5 ml-md-5"> |
| 17 | + <h3 class="text-gray-dark mr-3 mr-sm-0">Share</h3> |
| 18 | + <ul class="d-flex d-sm-block list-style-none"> |
| 19 | + {% for account in shareable_social_media %} |
| 20 | + <li class="mt-sm-3"> |
| 21 | + {% assign service_shortname = account[0] %} |
| 22 | + {% assign service = site.data.social_media[service_shortname] %} |
| 23 | + <a href="{% service.share_url_prefix %}{% page.url | prepend: site.url | prepend: site.baseurl | url_encode %}" title="Share on {{ service.name }}" class="d-flex flex-items-center"> |
| 24 | + <div style="width:32px">{{ service.icon_svg }}</div><span class="d-none d-sm-inline-block text-gray-light">{{ service.name }}</span> |
| 25 | + </a> |
| 26 | + </li> |
| 27 | + {% endfor %} |
| 28 | + </ul> |
| 29 | + </div> |
| 30 | + {% endif %} |
19 | 31 | {% endif %} |
20 | 32 | <div class="article"> |
21 | 33 | {{ content }} |
|
0 commit comments