Skip to content

feat(contact): Adds GitLab for sidebar. Only display contacts that are configured. #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions _data/contact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
- type: github
icon: "fab fa-github"

- type: gitlab
icon: "fab fa-gitlab"

- type: twitter
icon: "fa-brands fa-x-twitter"

Expand Down
12 changes: 8 additions & 4 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@

{% for entry in site.data.contact %}
{% case entry.type %}
{% when 'github', 'twitter' %}
{%- capture url -%}
https://{{ entry.type }}.com/{{ site[entry.type].username }}
{%- endcapture -%}
{% when 'github', 'gitlab', 'twitter' %}
{% 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 -%}
Expand Down