web/_includes/sidebar.html

96 lines
3 KiB
HTML
Raw Normal View History

2019-09-30 15:38:41 +03:00
<!--
The Side Bar
2020-01-02 16:17:49 +03:00
v2.0
https://github.com/cotes2020/jekyll-theme-chirpy
2019-09-30 15:38:41 +03:00
© 2017-2019 Cotes Chung
MIT License
-->
<div id="sidebar" class="d-flex flex-column align-items-end">
2020-11-21 23:24:09 +03:00
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ '/' | relative_url }}" alt="avatar" class="mx-auto">
{% capture avatar_url %}
{%- if site.avatar contains '://' -%}
{{ site.avatar }}
{%- elsif site.img_cdn != '' and site.img_cdn -%}
{{ site.avatar | prepend: site.img_cdn }}
{%- else -%}
{{ site.avatar | relative_url }}
{%- endif -%}
{% endcapture %}
2020-06-02 11:18:40 +03:00
<img src="{{ avatar_url }}" alt="avatar" onerror="this.style.display='none'">
2019-09-30 15:38:41 +03:00
</a>
</div>
<div class="site-title mt-3">
<a href="{{ '/' | relative_url }}">{{- site.title -}}</a>
</div>
2019-09-30 15:38:41 +03:00
<div class="site-subtitle font-italic">{{- site.tagline -}}</div>
</div><!-- .profile-wrapper -->
<ul class="w-100">
2020-11-21 23:24:09 +03:00
<!-- home -->
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">
<a href="{{ '/' | relative_url }}" class="nav-link">
2020-11-21 23:24:09 +03:00
<i class="fa-fw fas fa-home ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ "HOME" }}</span>
</a>
</li>
<!-- the real tabs -->
{% for tab in site.tabs %}
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
<a href="{{ tab.url | relative_url }}" class="nav-link">
2020-11-21 23:24:09 +03:00
<i class="fa-fw {{ tab.icon }} ml-xl-3 mr-xl-3 unloaded"></i>
<span>{{ tab.title | upcase }}</span>
2019-09-30 15:38:41 +03:00
</a>
</li> <!-- .nav-item -->
2020-11-21 23:24:09 +03:00
{% endfor %}
2019-09-30 15:38:41 +03:00
</ul> <!-- ul.nav.flex-column -->
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center">
{% 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:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')
{%- elsif entry.type == 'rss' -%}
{{ "/feed.xml" | relative_url }}
{%- else -%}
{{ entry.url }}
{%- endif -%}
{% endcapture %}
2019-09-30 15:38:41 +03:00
{% if url %}
<a href="{{ url }}" aria-label="{{ entry.type }}"
{% unless site.theme_mode %}class="order-{{ forloop.index | plus: 2 }}"{% endunless %}
{% unless entry.noblank %}target="_blank" rel="noopener"{% endunless %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% endfor %}
2020-02-13 12:46:05 +03:00
{% unless site.theme_mode %}
{% if site.data.contact.size > 0 %}
<span class="icon-border order-2"></span>
{% endif %}
2020-02-13 12:46:05 +03:00
<span id="mode-toggle-wrapper" class="order-1">
{% include mode-toggle.html %}
</span>
{% endunless %}
</div> <!-- .sidebar-bottom -->
2020-02-13 12:46:05 +03:00
</div><!-- #sidebar -->