navbar.html 4.45 KB
Newer Older
1
2
3
{% comment %}
  Lesson navigation bar.
{% endcomment %}
4

5
{% include gh_variables.html %}
6

Greg Wilson's avatar
Greg Wilson committed
7
8
9
<nav class="navbar navbar-default">
  <div class="container-fluid">
    <div class="navbar-header">
Greg Wilson's avatar
Greg Wilson committed
10
11
12
13
14
15
      <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
16
17

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

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

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

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

Greg Wilson's avatar
Greg Wilson committed
46
        {% if site.kind == "lesson" %}
Raniere Silva's avatar
Raniere Silva committed
47
	{% comment %} Show setup instructions. {% endcomment %}
48
        <li><a href="{{ relative_root_path }}{% link setup.md %}">Setup</a></li>
Raniere Silva's avatar
Raniere Silva committed
49
50

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

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

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