navbar.html 3.7 KB
Newer Older
Greg Wilson's avatar
Greg Wilson committed
1
2
3
4
5
6
7
8
9
{% comment %}
  If previewing locally, site.root is set in _config_dev.yml.
  If site.root is not set, assume we're viewing on the web.
{% endcomment %}
{% if site.root %}
  {% assign root = site.root %}
{% else %}
  {% assign root = site.github.url %}
{% endif %}
Greg Wilson's avatar
Greg Wilson committed
10
11
12
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
Greg Wilson's avatar
Greg Wilson committed
13
14
15
16
17
18
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
Greg Wilson's avatar
Greg Wilson committed
19
20

      {% comment %} Select what logo to display. {% endcomment %}
Greg Wilson's avatar
Greg Wilson committed
21
22
      {% if page.carpentry == "swc" %}
      <a href="{{ site.swc_site }}" class="pull-left">
Greg Wilson's avatar
Greg Wilson committed
23
        <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
Greg Wilson's avatar
Greg Wilson committed
24
25
26
      </a>
      {% elsif page.carpentry == "dc" %}
      <a href="{{ site.dc_site }}" class="pull-left">
Greg Wilson's avatar
Greg Wilson committed
27
        <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
Greg Wilson's avatar
Greg Wilson committed
28
29
30
      </a>
      {% elsif site.carpentry == "swc" %}
      <a href="{{ site.swc_site }}" class="pull-left">
Greg Wilson's avatar
Greg Wilson committed
31
        <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
Greg Wilson's avatar
Greg Wilson committed
32
33
34
      </a>
      {% elsif site.carpentry == "dc" %}
      <a href="{{ site.dc_site }}" class="pull-left">
Greg Wilson's avatar
Greg Wilson committed
35
        <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
Greg Wilson's avatar
Greg Wilson committed
36
37
      </a>
      {% endif %}
Greg Wilson's avatar
Greg Wilson committed
38
39
40
41

      {% comment %} Always show link to home page. {% endcomment %}
      <a class="navbar-brand" href="{{ root }}/">Home</a>

Greg Wilson's avatar
Greg Wilson committed
42
43
44
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
Greg Wilson's avatar
Greg Wilson committed
45
46
47
48
49

	{% comment %} Always show code of conduct. {% endcomment %}
        <li><a href="{{ root }}/conduct/">Code of Conduct</a></li>

	{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
Greg Wilson's avatar
Greg Wilson committed
50
        {% if site.kind == "lesson" %}
Greg Wilson's avatar
Greg Wilson committed
51
52
        <li><a href="{{ root }}/setup/">Setup</a></li>
        <li><a href="{{ root }}/reference/">Reference</a></li>
Greg Wilson's avatar
Greg Wilson committed
53
        <li class="dropdown">
Greg Wilson's avatar
Greg Wilson committed
54
          <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
Greg Wilson's avatar
Greg Wilson committed
55
56
          <ul class="dropdown-menu">
            {% for episode in site.episodes %}
Greg Wilson's avatar
Greg Wilson committed
57
            <li><a href="{{ root }}{{ episode.url }}">{{ episode.title }}</a></li>
Greg Wilson's avatar
Greg Wilson committed
58
59
60
            {% endfor %}
          </ul>
        </li>
Greg Wilson's avatar
Greg Wilson committed
61
62
63
64
	{% endif %}

	{% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
	{% if site.kind == "lesson" or site.repository_name == "workshop-template" %}
Greg Wilson's avatar
Greg Wilson committed
65
        <li class="dropdown">
Greg Wilson's avatar
Greg Wilson committed
66
          <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
Greg Wilson's avatar
Greg Wilson committed
67
68
          <ul class="dropdown-menu">
            {% for extra in site.extras %}
Greg Wilson's avatar
Greg Wilson committed
69
            <li><a href="{{ root }}{{ extra.url }}">{{ extra.title }}</a></li>
Greg Wilson's avatar
Greg Wilson committed
70
71
72
            {% endfor %}
          </ul>
        </li>
Greg Wilson's avatar
Greg Wilson committed
73
74
75
76
	{% endif %}

	{% comment %} Always show license. {% endcomment %}
        <li><a href="{{ root }}/license/">License</a></li>
Greg Wilson's avatar
Greg Wilson committed
77
78
79
80
81
82
83
84
85
      </ul>
      <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
        <div class="form-group">
          <input type="text" id="google-search" placeholder="Search...">
        </div>
      </form>
    </div>
  </div>
</nav>