aboutsummaryrefslogtreecommitdiff
path: root/theme/bulma/templates/partial/sidebar.html
blob: 75ebaf165054fa33387a614944f55c803ba61541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<aside>
  <div>
    <a href="{{ SITEURL }}/">
      {% if SITELOGO %}
      <img src="{{ SITELOGO }}" alt="{{ SITETITLE }}" title="{{ SITETITLE }}">
      {% else %}
      <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/img/profile.webp" alt="{{ SITETITLE }}" title="{{ SITETITLE }}">
      {% endif %}
    </a>

    <div>
      <p class="title is-1">
        <a href="{{ SITEURL }}/">{{ SITETITLE }}</a>
      </p>
      {% if SITESUBTITLE %}
      <p class="subtitle">{{ SITESUBTITLE }}</p>
      {% endif %}
    </div>

    {% if (pages and DISPLAY_PAGES_ON_MENU) or LINKS %}
    <nav class="content">
      <ul class="list">
        {# Open links in new window depending on the LINKS_IN_NEW_TAB setting #}
        {% macro get_target(link) -%}
          {%- if LINKS_IN_NEW_TAB in ('all', true) -%}
          _blank
          {%- elif LINKS_IN_NEW_TAB == "external" and not link.startswith("/") and not link.startswith(SITEURL) -%}
          _blank
          {%- else -%}
          _self
          {%- endif -%}
        {%- endmacro %}

        {% if PAGES_SORT_ATTRIBUTE -%}
          {% set pages = pages|sort(attribute=PAGES_SORT_ATTRIBUTE) %}
        {%- endif %}

        {% if DISPLAY_PAGES_ON_MENU %}
          {% for page in pages %}
            <li>
              <a target="{{ get_target(SITEURL) }}"
                 href="{{ SITEURL }}/{{ page.url }}{% if not DISABLE_URL_HASH %}#{{ page.slug }}{% endif %}">
                {{ page.title }}
              </a>
            </li>
          {% endfor %}
        {% endif %}

        {% for name, link in LINKS %}
          <li>
            <a target="{{ get_target(link) }}" href="{{ link }}" >{{ name }}</a>
          </li>
        {% endfor %}
      </ul>
    </nav>
    {% endif %}

    {% if SOCIAL %}
    {% set solid = ['at', 'envelope', 'mailbox', 'rss'] %}
    {% set relme = ['at', 'envelope', 'mailbox', 'mastodon'] %}
    <ul class="social">
      {% for name, link in SOCIAL %}
      <li>
        <a class="sc-{{ name }}"
           {% if name in relme %}rel="me"{% endif %}
           href="{{ link }}"
           target="_blank">
          <i class="{% if name in solid %}fa-solid{% else %}fa{% endif %} fa-{{ name }}"></i>
        </a>
      </li>
      {% endfor %}
    </ul>
    {% endif %}

    <button class="button is-ghost is-medium theme-switch"><i class="fa fa-adjust" aria-hidden="true" onclick="modeSwitcher()"></i></button>
  </div>

</aside>