navbar.html 4.27 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 %}
15
      {% if site.carpentry == "swc" %}
Greg Wilson's avatar
Greg Wilson committed
16
      <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
      </a>
19
      {% elsif site.carpentry == "dc" %}
Greg Wilson's avatar
Greg Wilson committed
20
      <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 site.carpentry == "lc" %}
Greg Wilson's avatar
Greg Wilson committed
24
      <a href="{{ site.lc_site }}" class="pull-left">
25
26
27
28
        <img class="navbar-logo" src="{{ page.root }}/assets/img/lc-icon-black.svg" alt="Library Carpentry logo" />
      </a>
      {% elsif site.carpentry == "cp" %}
      <a href="{{ site.carpentries_site }}" class="pull-left">
29
        <img class="navbar-logo" src="{{ page.root }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" />
30
      </a>
Greg Wilson's avatar
Greg Wilson committed
31
      {% endif %}
Greg Wilson's avatar
Greg Wilson committed
32
33

      {% comment %} Always show link to home page. {% endcomment %}
Raniere Silva's avatar
Raniere Silva committed
34
      <a class="navbar-brand" href="{{ page.root }}{% link index.md %}">Home</a>
Greg Wilson's avatar
Greg Wilson committed
35

Greg Wilson's avatar
Greg Wilson committed
36
37
38
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
Greg Wilson's avatar
Greg Wilson committed
39
40

	{% comment %} Always show code of conduct. {% endcomment %}
41
        <li><a href="{{ page.root }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>
Greg Wilson's avatar
Greg Wilson committed
42

Greg Wilson's avatar
Greg Wilson committed
43
        {% if site.kind == "lesson" %}
Raniere Silva's avatar
Raniere Silva committed
44
45
46
47
	{% comment %} Show setup instructions. {% endcomment %}
        <li><a href="{{ page.root }}{% link setup.md %}">Setup</a></li>

        {% comment %} Show lesson episodes for lessons. {% endcomment %}
Greg Wilson's avatar
Greg Wilson committed
48
        <li class="dropdown">
49
          <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
50
51
          <ul class="dropdown-menu">
            {% for episode in site.episodes %}
52
            <li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
Greg Wilson's avatar
Greg Wilson committed
53
            {% endfor %}
54
	    <li role="separator" class="divider"></li>
Raniere Silva's avatar
Raniere Silva committed
55
            <li><a href="{{ page.root }}{% link aio.md %}">All in one page (Beta)</a></li>
Greg Wilson's avatar
Greg Wilson committed
56
57
          </ul>
        </li>
Greg Wilson's avatar
Greg Wilson committed
58
59
60
	{% endif %}

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

	{% comment %} Always show license. {% endcomment %}
Raniere Silva's avatar
Raniere Silva committed
74
        <li><a href="{{ page.root }}{% link LICENSE.md %}">License</a></li>
75
76
77
78
79
	{% if page.source %}
	{% if page.source == "Rmd" %}
	<li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
	{% endif %}
	{% else %}
80
	<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>
81
	{% endif %}
Greg Wilson's avatar
Greg Wilson committed
82
83
84
      </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
85
          <input type="text" id="google-search" placeholder="Search..." aria-label="Google site search">
Greg Wilson's avatar
Greg Wilson committed
86
87
88
89
90
        </div>
      </form>
    </div>
  </div>
</nav>