From eb5457c6e5b8df05235effb98104ee615e0a606e Mon Sep 17 00:00:00 2001 From: Jason Raveling Date: Mon, 21 Apr 2025 17:07:24 -0500 Subject: [PATCH 1/3] feat(contact): Adds GitLab as a configurable contact for the sidebar. --- _config.yml | 3 +++ _data/contact.yml | 3 +++ _includes/sidebar.html | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index d6f84c57815..81624d6e1ed 100644 --- a/_config.yml +++ b/_config.yml @@ -28,6 +28,9 @@ url: "" github: username: github_username # change to your GitHub username +gitlab: + username: gitlab_username # change to your GitLab username + twitter: username: twitter_username # change to your Twitter username diff --git a/_data/contact.yml b/_data/contact.yml index ed40acb7e97..ecfe5a9d062 100644 --- a/_data/contact.yml +++ b/_data/contact.yml @@ -3,6 +3,9 @@ - type: github icon: "fab fa-github" +- type: gitlab + icon: "fab fa-github" + - type: twitter icon: "fa-brands fa-x-twitter" diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 569585f6f24..471867c5d25 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -53,7 +53,7 @@ {% for entry in site.data.contact %} {% case entry.type %} - {% when 'github', 'twitter' %} + {% when 'github', 'gitlab', 'twitter' %} {%- capture url -%} https://{{ entry.type }}.com/{{ site[entry.type].username }} {%- endcapture -%} From b80d2c94bad299a1bfc9c64043f1aa3a6c6a1538 Mon Sep 17 00:00:00 2001 From: Jason Raveling Date: Mon, 21 Apr 2025 17:20:02 -0500 Subject: [PATCH 2/3] fix(contact): Corrects FontAwesome CSS class for GitLab. --- _data/contact.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/contact.yml b/_data/contact.yml index ecfe5a9d062..e27815fe636 100644 --- a/_data/contact.yml +++ b/_data/contact.yml @@ -4,7 +4,7 @@ icon: "fab fa-github" - type: gitlab - icon: "fab fa-github" + icon: "fab fa-gitlab" - type: twitter icon: "fa-brands fa-x-twitter" From 2af505c5403e3635f25de5001a6f4aa49595f3ae Mon Sep 17 00:00:00 2001 From: Jason Raveling Date: Mon, 21 Apr 2025 18:31:17 -0500 Subject: [PATCH 3/3] refactor(contact): Adds conditional for unset contact options in _config.yml. For GitHub, GitLab, and Twitter, they will be displayed, regardless of a username being set or not. Updates the conditional for capture/assign of `url` so that it is `nil` if no username was provided. Then when the check for `url` is done for building the link, it will be skipped if no username is configured. --- _includes/sidebar.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 471867c5d25..1a4ded02aaf 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -54,9 +54,13 @@ {% for entry in site.data.contact %} {% case entry.type %} {% when 'github', 'gitlab', 'twitter' %} - {%- capture url -%} - https://{{ entry.type }}.com/{{ site[entry.type].username }} - {%- endcapture -%} + {% if site[entry.type].username %} + {%- capture url -%} + https://{{ entry.type }}.com/{{ site[entry.type].username }} + {%- endcapture -%} + {% else %} + {% assign url = nil %} + {% endif %} {% when 'email' %} {% assign email = site.social.email | split: '@' %} {%- capture url -%}