Skip to content

Commit 791dcc3

Browse files
committed
Switch to relative: use page.root in most templates
1 parent 4f08a69 commit 791dcc3

File tree

8 files changed

+28
-28
lines changed

8 files changed

+28
-28
lines changed

_includes/all_keypoints.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h2>Key Points</h2>
77
{% unless episode.break %}
88
<tr>
99
<td class="col-md-3">
10-
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
10+
<a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
1111
</td>
1212
<td class="col-md-9">
1313
<ul>

_includes/carpentries.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="row">
22
<div class="col-md-2" align="center">
3-
<a href="{{ site.swc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
3+
<a href="{{ site.swc_site }}"><img src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
44
</div>
55
<div class="col-md-8">
66
Since 1998,
@@ -14,7 +14,7 @@
1414
<br/>
1515
<div class="row">
1616
<div class="col-md-2" align="center">
17-
<a href="{{ site.dc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
17+
<a href="{{ site.dc_site }}"><img src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
1818
</div>
1919
<div class="col-md-8">
2020
<a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches workshops on the fundamental data skills needed to conduct research.

_includes/javascript.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/jquery.min.js"></script>
2-
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/bootstrap.min.js"></script>
3-
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/lesson.js"></script>
1+
<script src="{{ page.root }}/assets/js/jquery.min.js"></script>
2+
<script src="{{ page.root }}/assets/js/bootstrap.min.js"></script>
3+
<script src="{{ page.root }}/assets/js/lesson.js"></script>

_includes/main_title.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<h1 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
1+
<h1 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>

_includes/navbar.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,41 @@
1111
{% comment %} Select what logo to display. {% endcomment %}
1212
{% if page.carpentry == "swc" %}
1313
<a href="{{ site.swc_site }}" class="pull-left">
14-
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
14+
<img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
1515
</a>
1616
{% elsif page.carpentry == "dc" %}
1717
<a href="{{ site.dc_site }}" class="pull-left">
18-
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
18+
<img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
1919
</a>
2020
{% elsif site.carpentry == "swc" %}
2121
<a href="{{ site.swc_site }}" class="pull-left">
22-
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
22+
<img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
2323
</a>
2424
{% elsif site.carpentry == "dc" %}
2525
<a href="{{ site.dc_site }}" class="pull-left">
26-
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
26+
<img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
2727
</a>
2828
{% endif %}
2929

3030
{% comment %} Always show link to home page. {% endcomment %}
31-
<a class="navbar-brand" href="{{ site.github.url }}/">Home</a>
31+
<a class="navbar-brand" href="{{ page.root }}/">Home</a>
3232

3333
</div>
3434
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
3535
<ul class="nav navbar-nav">
3636

3737
{% comment %} Always show code of conduct. {% endcomment %}
38-
<li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li>
38+
<li><a href="{{ page.root }}/conduct/">Code of Conduct</a></li>
3939

4040
{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
4141
{% if site.kind == "lesson" %}
42-
<li><a href="{{ site.github.url }}/setup/">Setup</a></li>
43-
<li><a href="{{ site.github.url }}/reference/">Reference</a></li>
42+
<li><a href="{{ page.root }}/setup/">Setup</a></li>
43+
<li><a href="{{ page.root }}/reference/">Reference</a></li>
4444
<li class="dropdown">
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>
45+
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
4646
<ul class="dropdown-menu">
4747
{% for episode in site.episodes %}
48-
<li><a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a></li>
48+
<li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
4949
{% endfor %}
5050
</ul>
5151
</li>
@@ -54,17 +54,17 @@
5454
{% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
5555
{% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %}
5656
<li class="dropdown">
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>
57+
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
5858
<ul class="dropdown-menu">
5959
{% for extra in site.extras %}
60-
<li><a href="{{ site.github.url }}{{ extra.url }}">{{ extra.title }}</a></li>
60+
<li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
6161
{% endfor %}
6262
</ul>
6363
</li>
6464
{% endif %}
6565

6666
{% comment %} Always show license. {% endcomment %}
67-
<li><a href="{{ site.github.url }}/license/">License</a></li>
67+
<li><a href="{{ page.root }}/license/">License</a></li>
6868
</ul>
6969
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
7070
<div class="form-group">

_includes/syllabus.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>Schedule</h2>
3434
{% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
3535
<td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
3636
<td class="col-md-3">
37-
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
37+
<a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
3838
</td>
3939
<td class="col-md-7">
4040
{% if episode.break %}

_layouts/base.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<meta http-equiv="X-UA-Compatible" content="IE=edge">
88
<meta http-equiv="last-modified" content="{{ site.time }}">
99
<meta name="viewport" content="width=device-width, initial-scale=1">
10-
<meta name="search-domain" value="{{ site.github.url | replace_first: 'http:', 'https:' }}">
11-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" />
12-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" />
13-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
10+
<meta name="search-domain" value="{{ page.root }}">
11+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
12+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
13+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
1414
{% if site.carpentry == "swc" %}
1515
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
1616
{% endif %}

_layouts/workshop.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
<meta http-equiv="X-UA-Compatible" content="IE=edge">
2626
<meta http-equiv="last-modified" content="{{ site.time }}">
2727
<meta name="viewport" content="width=device-width, initial-scale=1">
28-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" />
29-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" />
30-
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
28+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
29+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
30+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
3131
{% if site.carpentry == "swc" %}
3232
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
3333
{% endif %}

0 commit comments

Comments
 (0)