web/_includes/sidebar.html

104 lines
3.4 KiB
HTML
Raw Normal View History

2019-09-30 15:38:41 +03:00
<!--
The Side Bar
-->
<div id="sidebar" class="d-flex flex-column align-items-end">
<div class="profile-wrapper text-center">
<div id="avatar">
<a href="{{ '/' | relative_url }}" class="mx-auto">
{% if site.avatar != empty and site.avatar %}
{% capture avatar_url %}
{% if site.avatar contains '://' %}
{{ site.avatar }}
{% elsif site.img_cdn != empty and site.img_cdn %}
{{ site.avatar | prepend: site.img_cdn }}
{% else %}
{{ site.avatar | relative_url }}
{% endif %}
{% endcapture %}
<img src="{{ avatar_url | strip }}" alt="avatar" onerror="this.style.display='none'">
{% endif %}
2019-09-30 15:38:41 +03:00
</a>
</div>
<div class="site-title">
2021-07-20 20:01:09 +03:00
<a href="{{ '/' | relative_url }}">{{ site.title }}</a>
</div>
2021-07-20 20:01:09 +03:00
<div class="site-subtitle font-italic">{{ site.tagline }}</div>
</div><!-- .profile-wrapper -->
<ul class="w-100">
2021-07-20 20:01:09 +03:00
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>
2022-10-18 22:53:47 +03:00
<span>{{ site.data.locales[site.lang].tabs.home | upcase }}</span>
2020-11-21 23:24:09 +03:00
</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>
2021-07-20 20:01:09 +03:00
{% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %}
2022-10-18 22:53:47 +03:00
<span>{{ site.data.locales[site.lang].tabs.[tab_name] | default: 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 -->
2021-09-21 17:37:28 +03:00
<div class="sidebar-bottom mt-auto d-flex flex-wrap justify-content-center align-items-center">
{% unless site.theme_mode %}
<button class="mode-toggle btn" aria-label="Switch Mode">
<i class="fas fa-adjust"></i>
</button>
{% if site.data.contact.size > 0 %}
<span class="icon-border"></span>
{% endif %}
{% endunless %}
{% 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 }}"
{% assign link_types = nil %}
{% unless entry.noblank %}
{% assign link_types = link_types | append: " noopener" %}
target="_blank"
{% endunless %}
{% if entry.type == 'mastodon' %}
{% assign link_types = link_types | append: " me" %}
{% endif %}
{% if link_types %}rel="{{ link_types | lstrip }}"{% endif %}>
<i class="{{ entry.icon }}"></i>
</a>
{% endif %}
{% endfor %}
2020-02-13 12:46:05 +03:00
</div> <!-- .sidebar-bottom -->
2020-02-13 12:46:05 +03:00
</div><!-- #sidebar -->