Skip to content

Commit 8c14933

Browse files
author
Nico is LOST
authored
Discord supports old and new invite code styles (daattali#1135)
1 parent cdfd011 commit 8c14933

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ social-network-links:
7373
# mastodon: instance.url/@username
7474
# ORCID: your ORCID ID
7575
# google-scholar: your google scholar
76-
# discord: invite/invite_code or users/userid
76+
# discord: "invite_code" or "users/userid" or "invite/invite_code"
7777
# kaggle: yourname
7878
# hackerrank: yourname
7979

_includes/social-networks-links.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,12 @@
301301
{%- endif -%}
302302

303303
{%- if site.social-network-links.discord -%}
304+
{% assign discord_start = site.social-network-links.discord | split: "/" | first -%}
305+
{% unless discord_start == 'users' or discord_start == 'invite' -%}
306+
{% assign discord_url_prefix = 'invite/' -%}
307+
{% endunless -%}
304308
<li class="list-inline-item">
305-
<a href="https://discord.com/{{ site.social-network-links.discord }}" title="Discord">
309+
<a href="https://discord.com/{{discord_url_prefix}}{{site.social-network-links.discord}}" title="Discord">
306310
<span class="fa-stack fa-lg" aria-hidden="true">
307311
<i class="fas fa-circle fa-stack-2x"></i>
308312
<i class="fab fa-discord fa-stack-1x fa-inverse"></i>

0 commit comments

Comments
 (0)