Use URI templates for social network links (#586)

This commit is contained in:
cketti 2020-03-15 22:41:12 +01:00 committed by GitHub
parent 7715136c82
commit f2ef9f238d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 24 deletions

View file

@ -6,14 +6,15 @@
{%- for link in site.social-network-links -%}
{%- assign curkey = link[0] -%}
{%- assign element = site.data.SocialNetworks[curkey] -%}
<li>
{%- if curkey == 'rss' -%}
<a href="{{ '/feed.xml' | relative_url }}" title="{{ element.name }}">
{%- elsif curkey == 'yelp' -%}
<a href="https://{{ site.social-network-links[curkey] }}.yelp.com" title="{{ element.name }}">
{%- capture url -%}{{ '/feed.xml' | relative_url }}{%- endcapture -%}
{%- else -%}
<a href="{{element.baseURL}}{{ site.social-network-links[curkey] }}" title="{{ element.name }}">
{%- assign value = site.social-network-links[curkey] -%}
{%- assign placeholder = "{value}" -%}
{%- capture url -%}{{ element.urlTemplate | replace: placeholder, value }}{%- endcapture -%}
{%- endif -%}
<li>
<a href="{{ url }}" title="{{ element.name }}">
<span class="fa-stack fa-lg" aria-hidden="true">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa {{ element.icon }} fa-stack-1x fa-inverse"></i>