|
1 |
| -{% comment %} |
2 |
| - If previewing locally, site.root is set in _config_dev.yml. |
3 |
| - If site.root is not set, assume we're viewing on the web. |
4 |
| -{% endcomment %} |
5 |
| -{% if site.root %} |
6 |
| - {% assign root = site.root %} |
7 |
| -{% else %} |
8 |
| - {% assign root = site.github.url %} |
9 |
| -{% endif %} |
10 | 1 | <nav class="navbar navbar-default">
|
11 | 2 | <div class="container-fluid">
|
12 | 3 | <div class="navbar-header">
|
|
20 | 11 | {% comment %} Select what logo to display. {% endcomment %}
|
21 | 12 | {% if page.carpentry == "swc" %}
|
22 | 13 | <a href="{{ site.swc_site }}" class="pull-left">
|
23 |
| - <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> |
| 14 | + <img class="navbar-logo" src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> |
24 | 15 | </a>
|
25 | 16 | {% elsif page.carpentry == "dc" %}
|
26 | 17 | <a href="{{ site.dc_site }}" class="pull-left">
|
27 |
| - <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> |
| 18 | + <img class="navbar-logo" src="{{ site.github.url }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> |
28 | 19 | </a>
|
29 | 20 | {% elsif site.carpentry == "swc" %}
|
30 | 21 | <a href="{{ site.swc_site }}" class="pull-left">
|
31 |
| - <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> |
| 22 | + <img class="navbar-logo" src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> |
32 | 23 | </a>
|
33 | 24 | {% elsif site.carpentry == "dc" %}
|
34 | 25 | <a href="{{ site.dc_site }}" class="pull-left">
|
35 |
| - <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> |
| 26 | + <img class="navbar-logo" src="{{ site.github.url }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> |
36 | 27 | </a>
|
37 | 28 | {% endif %}
|
38 | 29 |
|
39 | 30 | {% comment %} Always show link to home page. {% endcomment %}
|
40 |
| - <a class="navbar-brand" href="{{ root }}/">Home</a> |
| 31 | + <a class="navbar-brand" href="{{ site.github.url }}/">Home</a> |
41 | 32 |
|
42 | 33 | </div>
|
43 | 34 | <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
44 | 35 | <ul class="nav navbar-nav">
|
45 | 36 |
|
46 | 37 | {% comment %} Always show code of conduct. {% endcomment %}
|
47 |
| - <li><a href="{{ root }}/conduct/">Code of Conduct</a></li> |
| 38 | + <li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li> |
48 | 39 |
|
49 | 40 | {% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
|
50 | 41 | {% if site.kind == "lesson" %}
|
51 |
| - <li><a href="{{ root }}/setup/">Setup</a></li> |
52 |
| - <li><a href="{{ root }}/reference/">Reference</a></li> |
| 42 | + <li><a href="{{ site.github.url }}/setup/">Setup</a></li> |
| 43 | + <li><a href="{{ site.github.url }}/reference/">Reference</a></li> |
53 | 44 | <li class="dropdown">
|
54 |
| - <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a> |
| 45 | + <a href="{{ site.github.url }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a> |
55 | 46 | <ul class="dropdown-menu">
|
56 | 47 | {% for episode in site.episodes %}
|
57 |
| - <li><a href="{{ root }}{{ episode.url }}">{{ episode.title }}</a></li> |
| 48 | + <li><a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a></li> |
58 | 49 | {% endfor %}
|
59 | 50 | </ul>
|
60 | 51 | </li>
|
61 | 52 | {% endif %}
|
62 | 53 |
|
63 | 54 | {% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
|
64 |
| - {% if site.kind == "lesson" or site.repository_name == "workshop-template" %} |
| 55 | + {% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %} |
65 | 56 | <li class="dropdown">
|
66 |
| - <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a> |
| 57 | + <a href="{{ site.github.url }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a> |
67 | 58 | <ul class="dropdown-menu">
|
68 | 59 | {% for extra in site.extras %}
|
69 |
| - <li><a href="{{ root }}{{ extra.url }}">{{ extra.title }}</a></li> |
| 60 | + <li><a href="{{ site.github.url }}{{ extra.url }}">{{ extra.title }}</a></li> |
70 | 61 | {% endfor %}
|
71 | 62 | </ul>
|
72 | 63 | </li>
|
73 | 64 | {% endif %}
|
74 | 65 |
|
75 | 66 | {% comment %} Always show license. {% endcomment %}
|
76 |
| - <li><a href="{{ root }}/license/">License</a></li> |
| 67 | + <li><a href="{{ site.github.url }}/license/">License</a></li> |
77 | 68 | </ul>
|
78 | 69 | <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
|
79 | 70 | <div class="form-group">
|
|
0 commit comments