|
| 1 | +<!-- The Side Bar --> |
| 2 | + |
| 3 | +<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end"> |
| 4 | + <header class="profile-wrapper"> |
| 5 | + <a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle"> |
| 6 | + {%- if site.avatar != empty and site.avatar -%} |
| 7 | + {%- capture avatar_url -%} |
| 8 | + {% include media-url.html src=site.avatar %} |
| 9 | + {%- endcapture -%} |
| 10 | + <img src="{{- avatar_url -}}" width="112" height="112" alt="avatar" onerror="this.style.display='none'"> |
| 11 | + {%- endif -%} |
| 12 | + </a> |
| 13 | + |
| 14 | + <h1 class="site-title"> |
| 15 | + <a href="{{ '/' | relative_url }}">{{ site.title }}</a> |
| 16 | + </h1> |
| 17 | + <p class="site-subtitle fst-italic mb-0">{{ site.tagline }}</p> |
| 18 | + </header> |
| 19 | + <!-- .profile-wrapper --> |
| 20 | + |
| 21 | + <nav class="flex-column flex-grow-1 w-100 ps-0"> |
| 22 | + <ul class="nav"> |
| 23 | + <!-- home --> |
| 24 | + <li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}"> |
| 25 | + <a href="{{ '/' | relative_url }}" class="nav-link"> |
| 26 | + <i class="fa-fw fas fa-home"></i> |
| 27 | + <span>{{ site.data.locales[include.lang].tabs.home | upcase }}</span> |
| 28 | + </a> |
| 29 | + </li> |
| 30 | + <!-- the real tabs --> |
| 31 | + {% for tab in site.tabs %} |
| 32 | + <li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}"> |
| 33 | + <a href="{{ tab.url | relative_url }}" class="nav-link"> |
| 34 | + <i class="fa-fw {{ tab.icon }}"></i> |
| 35 | + {% capture tab_name %}{{ tab.url | split: '/' }}{% endcapture %} |
| 36 | + |
| 37 | + <span>{{ site.data.locales[include.lang].tabs.[tab_name] | default: tab.title | upcase }}</span> |
| 38 | + </a> |
| 39 | + </li> |
| 40 | + <!-- .nav-item --> |
| 41 | + {% endfor %} |
| 42 | + </ul> |
| 43 | + </nav> |
| 44 | + |
| 45 | + <div class="sidebar-bottom d-flex flex-wrap align-items-center w-100"> |
| 46 | + {% unless site.theme_mode %} |
| 47 | + <button type="button" class="btn btn-link nav-link" aria-label="Switch Mode" id="mode-toggle"> |
| 48 | + <i class="fas fa-adjust"></i> |
| 49 | + </button> |
| 50 | + |
| 51 | + {% if site.data.contact.size > 0 %} |
| 52 | + <span class="icon-border"></span> |
| 53 | + {% endif %} |
| 54 | + {% endunless %} |
| 55 | + |
| 56 | + {% for entry in site.data.contact %} |
| 57 | + {% case entry.type %} |
| 58 | + {% when 'github', 'twitter' %} |
| 59 | + {%- capture url -%} |
| 60 | + https://{{ entry.type }}.com/{{ site[entry.type].username }} |
| 61 | + {%- endcapture -%} |
| 62 | + {% when 'email' %} |
| 63 | + {% assign email = site.social.email | split: '@' %} |
| 64 | + {%- capture url -%} |
| 65 | + javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@') |
| 66 | + {%- endcapture -%} |
| 67 | + {% when 'rss' %} |
| 68 | + {% assign url = '/feed.xml' | relative_url %} |
| 69 | + {% else %} |
| 70 | + {% assign url = entry.url %} |
| 71 | + {% endcase %} |
| 72 | + |
| 73 | + {% if url %} |
| 74 | + <a |
| 75 | + href="{{ url }}" |
| 76 | + aria-label="{{ entry.type }}" |
| 77 | + {% assign link_types = '' %} |
| 78 | + |
| 79 | + {% unless entry.noblank %} |
| 80 | + target="_blank" |
| 81 | + {% assign link_types = 'noopener noreferrer' %} |
| 82 | + {% endunless %} |
| 83 | + |
| 84 | + {% if entry.type == 'mastodon' %} |
| 85 | + {% assign link_types = link_types | append: ' me' | strip %} |
| 86 | + {% endif %} |
| 87 | + |
| 88 | + {% unless link_types == empty %} |
| 89 | + rel="{{ link_types }}" |
| 90 | + {% endunless %} |
| 91 | + > |
| 92 | + <i class="{{ entry.icon }}"></i> |
| 93 | + </a> |
| 94 | + {% endif %} |
| 95 | + {% endfor %} |
| 96 | + </div> |
| 97 | + <!-- .sidebar-bottom --> |
| 98 | +</aside> |
| 99 | +<!-- #sidebar --> |
0 commit comments