Skip to content

Commit 716798e

Browse files
feat(social-links): allow subreddit (#1371)
1 parent e6fc968 commit 716798e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

_config.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ social-network-links:
5959
youtube: "@daattali"
6060
whatsapp: 15551212
6161
# medium: yourname
62-
# reddit: yourname
62+
# reddit: yourname or r/yoursubreddit
6363
# linkedin: daattali
6464
# xing: yourname
6565
# stackoverflow: "3943160/daattali"
@@ -76,7 +76,7 @@ social-network-links:
7676
# bluesky: yourname
7777
# ORCID: your ORCID ID
7878
# google-scholar: your google scholar
79-
# discord: "invite_code" or "users/userid" or "invite/invite_code"
79+
# discord: "invite_code" or "users/userid" or "invite/invite_code"
8080
# kaggle: yourname
8181
# hackerrank: yourname
8282
# gitlab: yourname
@@ -214,23 +214,23 @@ footer-hover-col: "#0085A1"
214214
# label: blog-comments # Label that will be assigned to GitHub Issues created by Utterances
215215

216216
# To use Staticman comments, uncomment the following section. You may leave the reCaptcha
217-
# section commented if you aren't using reCaptcha for spam protection.
218-
# Using Staticman requires advanced knowledge, please consult
219-
# https://github.com/eduardoboucas/staticman/ and https://staticman.net/ for further
220-
# instructions. For any support with staticman please direct questions to staticman and
217+
# section commented if you aren't using reCaptcha for spam protection.
218+
# Using Staticman requires advanced knowledge, please consult
219+
# https://github.com/eduardoboucas/staticman/ and https://staticman.net/ for further
220+
# instructions. For any support with staticman please direct questions to staticman and
221221
# not to BeautifulJekyll.
222222
#staticman:
223223
# repository : # GitHub username/repository eg. "daattali/beautiful-jekyll"
224224
# branch : master # If you're not using `master` branch, then you also need to update the `branch` parameter in `staticman.yml`
225225
# endpoint : # URL of your deployment, with a trailing slash eg. "https://<your-api>/v3/entry/github/"
226-
# reCaptcha: # (optional, set these parameters in `staticman.yml` as well)
226+
# reCaptcha: # (optional, set these parameters in `staticman.yml` as well)
227227
# siteKey : # You need to apply for a site key on Google
228228
# secret : # Encrypt your password by going to https://<your-own-api>/v3/encrypt/<your-site-secret>
229229

230230
# To use giscus comments:
231-
# (0) Uncomment the following giscus section, (1) Enable Discussions in your GitHub repository,
231+
# (0) Uncomment the following giscus section, (1) Enable Discussions in your GitHub repository,
232232
# (2) Install the giscus app in your repository (details at https://giscus.app),
233-
# (3) Fill in *all* the parameters below
233+
# (3) Fill in *all* the parameters below
234234
# See more details about giscus and each of the following parameters at https://giscus.app
235235
#giscus:
236236
# hostname: giscus.app # Replace with your giscus instance's hostname if self-hosting

_includes/social-networks-links.html

+8-4
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,12 @@
112112
{%- endif -%}
113113

114114
{%- if network[0] == "reddit" -%}
115+
{% assign reddit_start = network[1] | split: "/" | first -%}
116+
{% unless reddit_start == 'r' or reddit_start == 'u' -%}
117+
{% assign reddit_url_prefix = 'u/' -%}
118+
{% endunless -%}
115119
<li class="list-inline-item">
116-
<a href="https://reddit.com/u/{{ network[1] }}" title="Reddit">
120+
<a href="https://reddit.com/{{ reddit_url_prefix }}{{ network[1] }}" title="Reddit">
117121
<span class="fa-stack fa-lg" aria-hidden="true">
118122
<i class="fas fa-circle fa-stack-2x"></i>
119123
<i class="fab fa-reddit fa-stack-1x fa-inverse"></i>
@@ -314,7 +318,7 @@
314318
</a>
315319
</li>
316320
{%- endif -%}
317-
321+
318322
{%- if network[0] == "medium" -%}
319323
<li class="list-inline-item">
320324
<a href="https://medium.com/@{{ network[1] }}" title="Medium">
@@ -338,7 +342,7 @@
338342
</a>
339343
</li>
340344
{%- endif -%}
341-
345+
342346
{%- if network[0] == "discord" -%}
343347
{% assign discord_start = network[1] | split: "/" | first -%}
344348
{% unless discord_start == 'users' or discord_start == 'invite' -%}
@@ -354,7 +358,7 @@
354358
</a>
355359
</li>
356360
{%- endif -%}
357-
361+
358362
{%- if network[0] == "kaggle" -%}
359363
<li class="list-inline-item">
360364
<a href="https://www.kaggle.com/{{ network[1] }}" title="Kaggle">

0 commit comments

Comments
 (0)