mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-10-20 17:53:45 +00:00
fix: avoid unconfigured social options in sidebar (#2507)
This commit is contained in:
parent
eaf5e57449
commit
5f8ec7ffd3
@ -52,13 +52,21 @@
|
||||
{% endunless %}
|
||||
|
||||
{% for entry in site.data.contact %}
|
||||
{%- assign url = null -%}
|
||||
|
||||
{% case entry.type %}
|
||||
{% when 'github', 'twitter' %}
|
||||
{%- unless site[entry.type].username -%}
|
||||
{%- continue -%}
|
||||
{%- endunless -%}
|
||||
{%- capture url -%}
|
||||
https://{{ entry.type }}.com/{{ site[entry.type].username }}
|
||||
{%- endcapture -%}
|
||||
{% when 'email' %}
|
||||
{% assign email = site.social.email | split: '@' %}
|
||||
{%- unless site.social.email -%}
|
||||
{%- continue -%}
|
||||
{%- endunless -%}
|
||||
{%- assign email = site.social.email | split: '@' -%}
|
||||
{%- capture url -%}
|
||||
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
|
||||
{%- endcapture -%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user