navbar.html 4.2 KB
Newer Older
1
2
3
{% comment %}
  Lesson navigation bar.
{% endcomment %}
Greg Wilson's avatar
Greg Wilson committed
4
5
6
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
Greg Wilson's avatar
Greg Wilson committed
7
8
9
10
11
12
      <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
13
14

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

      {% comment %} Always show link to home page. {% endcomment %}
42
      <a class="navbar-brand" href="{{ page.root }}/">Home</a>
Greg Wilson's avatar
Greg Wilson committed
43

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

	{% comment %} Always show code of conduct. {% endcomment %}
49
        <li><a href="{{ page.root }}/conduct/">Code of Conduct</a></li>
Greg Wilson's avatar
Greg Wilson committed
50
51

	{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
Greg Wilson's avatar
Greg Wilson committed
52
        {% if site.kind == "lesson" %}
53
        <li><a href="{{ page.root }}/setup/">Setup</a></li>
Greg Wilson's avatar
Greg Wilson committed
54
        <li class="dropdown">
55
          <a href="{{ page.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
56
57
          <ul class="dropdown-menu">
            {% for episode in site.episodes %}
58
            <li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
Greg Wilson's avatar
Greg Wilson committed
59
60
61
            {% endfor %}
          </ul>
        </li>
Greg Wilson's avatar
Greg Wilson committed
62
63
64
	{% endif %}

	{% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
65
	{% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %}
Greg Wilson's avatar
Greg Wilson committed
66
        <li class="dropdown">
67
          <a href="{{ page.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
68
          <ul class="dropdown-menu">
Raniere Silva's avatar
Raniere Silva committed
69
            <li><a href="{{ page.root }}/reference/">Reference</a></li>
Greg Wilson's avatar
Greg Wilson committed
70
            {% for extra in site.extras %}
71
            <li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
Greg Wilson's avatar
Greg Wilson committed
72
73
74
            {% endfor %}
          </ul>
        </li>
Greg Wilson's avatar
Greg Wilson committed
75
76
77
	{% endif %}

	{% comment %} Always show license. {% endcomment %}
78
        <li><a href="{{ page.root }}/license/">License</a></li>
79
	<li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
Greg Wilson's avatar
Greg Wilson committed
80
81
82
      </ul>
      <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
        <div class="form-group">
evanwill's avatar
evanwill committed
83
          <input type="text" id="google-search" placeholder="Search..." aria-label="Google site search">
Greg Wilson's avatar
Greg Wilson committed
84
85
86
87
88
        </div>
      </form>
    </div>
  </div>
</nav>