Skip to content

Commit 8748a80

Browse files
committed
Switching to GitHub-defined variables
1 parent cf51440 commit 8748a80

12 files changed

+38
-84
lines changed

Makefile

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,16 @@ commands :
1717

1818
## serve : run a local server.
1919
serve : lesson-rmd
20-
${JEKYLL} serve --config _config.yml,_config_dev.yml
20+
${JEKYLL} serve
2121

2222
## site : build files but do not run a server.
2323
site : lesson-rmd
24-
${JEKYLL} build --config _config.yml,_config_dev.yml
24+
${JEKYLL} build
2525

2626
# repo-check : check repository settings.
2727
repo-check :
2828
@bin/repo_check.py -s .
2929

30-
3130
## clean : clean up junk files.
3231
clean :
3332
@rm -rf ${DST}

_config_dev.yml

-9
This file was deleted.

_includes/all_keypoints.html

+1-1
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.root }}{{ episode.url }}">{{ episode.title }}</a>
10+
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
1111
</td>
1212
<td class="col-md-9">
1313
<ul>

_includes/carpentries.html

+2-2
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.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
3+
<a href="{{ site.swc_site }}"><img src="{{ site.github.url }}/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.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
17+
<a href="{{ site.dc_site }}"><img src="{{ site.github.url }}/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/episode_title.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
<div class="col-md-1">
44
<h3>
55
{% if prev_episode %}
6-
<a href="{{ site.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
6+
<a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
77
{% else %}
8-
<a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
8+
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
99
{% endif %}
1010
</h3>
1111
</div>
1212
<div class="col-md-10">
13-
<h3 class="maintitle"><a href="{{ site.root }}/">{{ site.title }}</a></h3>
13+
<h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3>
1414
<h1 class="maintitle">{{ page.title }}</h1>
1515
</div>
1616
<div class="col-md-1">
1717
<h3>
1818
{% if next_episode %}
19-
<a href="{{ site.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
19+
<a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
2020
{% else %}
21-
<a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
21+
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
2222
{% endif %}
2323
</h3>
2424
</div>

_includes/javascript.html

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
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-
<script src="{{ root }}/assets/js/jquery.min.js"></script>
11-
<script src="{{ root }}/assets/js/bootstrap.min.js"></script>
12-
<script src="{{ root }}/assets/js/lesson.js"></script>
1+
<script src="{{ site.github.url }}/assets/js/jquery.min.js"></script>
2+
<script src="{{ site.github.url }}/assets/js/bootstrap.min.js"></script>
3+
<script src="{{ site.github.url }}/assets/js/lesson.js"></script>

_includes/lesson_footer.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ <h4>
1010
</div>
1111
<div class="col-md-6" align="right">
1212
<h4>
13-
<a href="{{ site.repo }}/">Source</a>
13+
<a href="{{ site.github.repository_url }}/">Source</a>
1414
/
15-
<a href="{{ site.repo }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
15+
<a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
1616
/
1717
<a href="mailto:{{ site.email }}">Contact</a>
1818
</h4>

_includes/main_title.html

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

_includes/navbar.html

+14-23
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
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 %}
101
<nav class="navbar navbar-default">
112
<div class="container-fluid">
123
<div class="navbar-header">
@@ -20,60 +11,60 @@
2011
{% comment %} Select what logo to display. {% endcomment %}
2112
{% if page.carpentry == "swc" %}
2213
<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" />
2415
</a>
2516
{% elsif page.carpentry == "dc" %}
2617
<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" />
2819
</a>
2920
{% elsif site.carpentry == "swc" %}
3021
<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" />
3223
</a>
3324
{% elsif site.carpentry == "dc" %}
3425
<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" />
3627
</a>
3728
{% endif %}
3829

3930
{% 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>
4132

4233
</div>
4334
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
4435
<ul class="nav navbar-nav">
4536

4637
{% 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>
4839

4940
{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
5041
{% 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>
5344
<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>
5546
<ul class="dropdown-menu">
5647
{% 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>
5849
{% endfor %}
5950
</ul>
6051
</li>
6152
{% endif %}
6253

6354
{% 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" %}
6556
<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>
6758
<ul class="dropdown-menu">
6859
{% 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>
7061
{% endfor %}
7162
</ul>
7263
</li>
7364
{% endif %}
7465

7566
{% 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>
7768
</ul>
7869
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
7970
<div class="form-group">

_includes/syllabus.html

+1-1
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.root }}{{ episode.url }}">{{ episode.title }}</a>
37+
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
3838
</td>
3939
<td class="col-md-7">
4040
{% if episode.break %}

_layouts/base.html

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
---
22
---
3-
{% comment %}
4-
If previewing locally, site.root is set in _config_dev.yml.
5-
If site.root is not set, assume we're viewing on the web.
6-
{% endcomment %}
7-
{% if site.root %}
8-
{% assign root = site.root %}
9-
{% else %}
10-
{% assign root = site.github.url %}
11-
{% endif %}
123
<!doctype html>
134
<html lang="en">
145
<head>
156
<meta charset="utf-8">
167
<meta http-equiv="X-UA-Compatible" content="IE=edge">
178
<meta http-equiv="last-modified" content="{{ site.time }}">
189
<meta name="viewport" content="width=device-width, initial-scale=1">
19-
<meta name="search-domain" value="{{ root }}">
20-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap.css" />
21-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap-theme.css" />
22-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/lesson.css" />
10+
<meta name="search-domain" value="{{ site.github.url }}">
11+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap.css" />
12+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap-theme.css" />
13+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/lesson.css" />
2314
{% if site.carpentry == "swc" %}
2415
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
2516
{% endif %}

_layouts/workshop.html

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
---
22
---
3-
{% comment %}
4-
If previewing locally, site.root is set in _config_dev.yml.
5-
If site.root is not set, assume we're viewing on the web.
6-
{% endcomment %}
7-
{% if site.root %}
8-
{% assign root = site.root %}
9-
{% else %}
10-
{% assign root = site.github.url %}
11-
{% endif %}
123
<!doctype html>
134
<html lang="en">
145
<head>
@@ -34,9 +25,9 @@
3425
<meta http-equiv="X-UA-Compatible" content="IE=edge">
3526
<meta http-equiv="last-modified" content="{{ site.time }}">
3627
<meta name="viewport" content="width=device-width, initial-scale=1">
37-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap.css" />
38-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap-theme.css" />
39-
<link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/lesson.css" />
28+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap.css" />
29+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap-theme.css" />
30+
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/lesson.css" />
4031
{% if site.carpentry == "swc" %}
4132
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
4233
{% endif %}

0 commit comments

Comments
 (0)