Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Feature: make contact options configurable (artemsheludko#58, artemsh…
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed May 23, 2020
1 parent 712be12 commit cba2748
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 13 deletions.
28 changes: 28 additions & 0 deletions _data/contact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# The contact options.
# v2.3
# https://github.com/cotes2020/jekyll-theme-chirpy
# © 2020 Cotes Chung
# MIT Licensed

-
type: github
icon: 'fab fa-github-alt'
-
type: twitter
icon: 'fab fa-twitter'
-
type: email
icon: 'fas fa-envelope'
noblank: true # open link in current tab
-
type: rss
icon: 'fas fa-rss'
noblank: true

# Complete the url below to enable more contact options
-
icon: 'fab fa-linkedin' # icons powered by <https://fontawesome.com/>
url: '' # Fill with your Linkedin homepage
-
icon: 'fab fa-stack-overflow'
url: '' # Fill with your stackoverflow homepage
35 changes: 22 additions & 13 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,27 @@
<span class="icon-border"></span>
{% endif %}

<a href="https://github.com/{{ site.github.username }}" target="_blank">
<i class="fab fa-github-alt"></i>
</a>
<a href="https://twitter.com/{{ site.twitter.username }}" target="_blank">
<i class="fab fa-twitter"></i>
</a>
{% assign email = site.social.email | split: '@' %}
<a href="javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))">
<i class="fas fa-envelope"></i>
</a>
<a href="{{ site.baseurl }}/feed.xml" target="_blank">
<i class="fas fa-rss"></i>
</a>
{% for entry in site.data.contact %}
{% capture url %}
{%- if entry.type == 'github' -%}
https://github.com/{{ site.github.username }}
{%- elsif entry.type == 'twitter' -%}
https://twitter.com/{{ site.twitter.username }}
{%- elsif entry.type == 'email' -%}
{% assign email = site.social.email | split: '@' %}
javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@'))
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}

{% if url != '' %}
<a href="{{ url }}" {% unless entry.noblank %}target="_blank"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% endfor %}

</div>

0 comments on commit cba2748

Please sign in to comment.