|
1 | 1 | <div id="share">
|
2 | 2 | Share on
|
3 | 3 |
|
4 |
| - <span title="Share this on Mastodon" class="btn" style="background-color: #6260fa; cursor: pointer;" onclick="mastodon_modal()">Mastodon</span> |
| 4 | + <span title="Share this on Mastodon" class="btn" style="background-color: #6260fa; cursor: pointer;" |
| 5 | + onclick="mastodon_modal()">Mastodon</span> |
5 | 6 |
|
6 | 7 | {% for butt in site.sharebuttons %}
|
| 8 | + {%- assign elems = "" | split: "" -%} |
| 9 | + |
| 10 | + {%- if butt.title -%} |
| 11 | + {%- assign title = butt.title | append: '=' -%} |
| 12 | + {%- assign title = title | append: page.title | uri_escape -%} |
| 13 | + {%- assign elems = title | split: '\n' | concat: elems -%} |
| 14 | + {%- endif -%} |
| 15 | + |
| 16 | + {%- if butt.body -%} |
| 17 | + {%- assign body = butt.body | append: '=' -%} |
| 18 | + {%- assign body = body | append: '%0A' -%} |
| 19 | + {%- assign body = body | append: 'https://ellietheyeen.github.io' | append: page.url | uri_escape -%} |
| 20 | + {%- assign body = body | '%0A' -%} |
| 21 | + {%- assign elems = body | split: '\n' | concat: elems -%} |
| 22 | + {%- endif -%} |
| 23 | + |
| 24 | + {%- if butt.media -%} |
| 25 | + {%- assign media = butt.media | append: '=' -%} |
| 26 | + {%- assign mediaurl = page.image | absolute_url -%} |
| 27 | + {%- assign media = media | append: mediaurl -%} |
| 28 | + {%- assign elems = media | split: '\n' | concat: elems -%} |
| 29 | + {%- endif -%} |
| 30 | + |
| 31 | + {%- if butt.url -%} |
| 32 | + {%- assign url = butt.url | append: '=' -%} |
| 33 | + {%- assign url = url | append: 'https://ellietheyeen.github.io' | append: page.url | uri_escape -%} |
| 34 | + {%- assign elems = url | split: '\n' | concat: elems -%} |
| 35 | + {%- endif -%} |
| 36 | + |
| 37 | + {%- if butt.extra -%} |
| 38 | + {%- assign elems = butt.extra | split: '\n' | concat: elems -%} |
| 39 | + {%- endif -%} |
| 40 | + |
7 | 41 | <a class="sharelink" title="Share this on {{ butt.name }}" target="_blank"
|
8 |
| - href="{{ butt.base }}?{%- if butt.extra -%}{{ butt.extra }}{%- endif -%}{%- if butt.url -%}&{{ butt.url }}={{ 'https://ellietheyeen.github.io' | append: page.url | uri_escape }}{%- endif -%}{%- if butt.title -%}&{{ butt.title }}={{ page.title | uri_escape }}{%- endif -%}{%- if butt.body -%}&{{ butt.body }}={{ page.title | uri_escape }}%0A{{ 'https://ellietheyeen.github.io' | append: page.url | uri_escape }}%0A{%- endif -%}{%- if butt.media -%}&{{ butt.media }}={{ page.image | absolute_url }}{%- endif -%}"> |
| 42 | + href="{{ butt.base }}?{{ elems | join: '&' }}"> |
9 | 43 | <span class="btn" style="background-color: {{ butt.color }};">{{ butt.name }}</span>
|
10 | 44 | </a>
|
11 | 45 | {% endfor %}
|
|
0 commit comments