1
0
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:
Jason Raveling 2025-08-31 08:51:01 -05:00 committed by GitHub
parent eaf5e57449
commit 5f8ec7ffd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -52,13 +52,21 @@
{% endunless %} {% endunless %}
{% for entry in site.data.contact %} {% for entry in site.data.contact %}
{%- assign url = null -%}
{% case entry.type %} {% case entry.type %}
{% when 'github', 'twitter' %} {% when 'github', 'twitter' %}
{%- unless site[entry.type].username -%}
{%- continue -%}
{%- endunless -%}
{%- capture url -%} {%- capture url -%}
https://{{ entry.type }}.com/{{ site[entry.type].username }} https://{{ entry.type }}.com/{{ site[entry.type].username }}
{%- endcapture -%} {%- endcapture -%}
{% when 'email' %} {% when 'email' %}
{% assign email = site.social.email | split: '@' %} {%- unless site.social.email -%}
{%- continue -%}
{%- endunless -%}
{%- assign email = site.social.email | split: '@' -%}
{%- capture url -%} {%- capture url -%}
javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@') javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- endcapture -%} {%- endcapture -%}