From 8c1493387a0c3694e322437da703454bd28b0788 Mon Sep 17 00:00:00 2001 From: Nico is LOST Date: Mon, 15 May 2023 07:16:48 +0200 Subject: [PATCH] Discord supports old and new invite code styles (#1135) --- _config.yml | 2 +- _includes/social-networks-links.html | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/_config.yml b/_config.yml index 5a9dc736bd30..a4d3a918d3b5 100644 --- a/_config.yml +++ b/_config.yml @@ -73,7 +73,7 @@ social-network-links: # mastodon: instance.url/@username # ORCID: your ORCID ID # google-scholar: your google scholar -# discord: invite/invite_code or users/userid +# discord: "invite_code" or "users/userid" or "invite/invite_code" # kaggle: yourname # hackerrank: yourname diff --git a/_includes/social-networks-links.html b/_includes/social-networks-links.html index 8ca4c6d2a5e7..6ca15a0dbc64 100644 --- a/_includes/social-networks-links.html +++ b/_includes/social-networks-links.html @@ -301,8 +301,12 @@ {%- endif -%} {%- if site.social-network-links.discord -%} + {% assign discord_start = site.social-network-links.discord | split: "/" | first -%} + {% unless discord_start == 'users' or discord_start == 'invite' -%} + {% assign discord_url_prefix = 'invite/' -%} + {% endunless -%}
  • - +