Skip to content

Commit d0b3cf4

Browse files
committed
Merge branch 'gh-pages' into adding-jquery-debugging
2 parents cf5d417 + 37a3a11 commit d0b3cf4

19 files changed

+129
-50
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/episode_break.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{% comment %}
2-
Display information about a break.
2+
Display a break's timings in a box similar to a learning episode's.
33
{% endcomment %}
4-
<p>Break: {{page.break}} min</p>
4+
<blockquote class="objectives">
5+
<h2>Overview</h2>
6+
7+
<div class="row">
8+
<div class="col-md-3">
9+
<strong>Break:</strong> {{ page.break }} min
10+
</div>
11+
<div class="col-md-9">
12+
</div>
13+
</div>
14+
15+
</blockquote>

_includes/episode_navbar.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% comment %}
2+
Find previous and next episodes (if any).
3+
{% endcomment %}
4+
{% for episode in site.episodes %}
5+
{% if episode.url == page.url %}
6+
{% unless forloop.first %}
7+
{% assign prev_episode = prev %}
8+
{% endunless %}
9+
{% unless forloop.last %}
10+
{% assign next_episode = site.episodes[forloop.index] %}
11+
{% endunless %}
12+
{% endif %}
13+
{% assign prev = episode %}
14+
{% endfor %}
15+
16+
{% comment %}
17+
Display title and prev/next links.
18+
{% endcomment %}
19+
<div class="row">
20+
<div class="col-md-1">
21+
<h3>
22+
{% if prev_episode %}
23+
<a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
24+
{% else %}
25+
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
26+
{% endif %}
27+
</h3>
28+
</div>
29+
<div class="col-md-10">
30+
{% if include.episode_navbar_title %}
31+
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
32+
<h1 class="maintitle">{{ page.title }}</h1>
33+
{% endif %}
34+
</div>
35+
<div class="col-md-1">
36+
<h3>
37+
{% if next_episode %}
38+
<a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
39+
{% else %}
40+
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
41+
{% endif %}
42+
</h3>
43+
</div>
44+
</div>

_includes/episode_overview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h2>Overview</h2>
77
<div class="row">
88
<div class="col-md-3">
99
<strong>Teaching:</strong> {{ page.teaching }} min
10-
</br>
10+
<br/>
1111
<strong>Exercises:</strong> {{ page.exercises }} min
1212
</div>
1313
<div class="col-md-9">
@@ -19,7 +19,7 @@ <h2>Overview</h2>
1919
</ul>
2020
</div>
2121
</div>
22-
22+
2323
<div class="row">
2424
<div class="col-md-3">
2525
</div>
@@ -32,5 +32,5 @@ <h2>Overview</h2>
3232
</ul>
3333
</div>
3434
</div>
35-
35+
3636
</blockquote>

_includes/episode_title.html

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,22 @@
2020
<div class="col-md-1">
2121
<h3>
2222
{% if prev_episode %}
23-
<a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
24-
{% elsif site.github.url %}
25-
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
23+
<a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
2624
{% else %}
27-
<a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
25+
<a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
2826
{% endif %}
2927
</h3>
3028
</div>
3129
<div class="col-md-10">
32-
<h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3>
30+
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
3331
<h1 class="maintitle">{{ page.title }}</h1>
3432
</div>
3533
<div class="col-md-1">
3634
<h3>
3735
{% if next_episode %}
38-
<a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
39-
{% elsif site.github.url %}
40-
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
36+
<a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
4137
{% else %}
42-
<a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
38+
<a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
4339
{% endif %}
4440
</h3>
4541
</div>

_includes/javascript.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
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>
4+
<script>
5+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
6+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
7+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
8+
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
9+
ga('create', 'UA-37305346-2', 'auto');
10+
ga('send', 'pageview');
11+
</script>

_includes/lesson_footer.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<hr/>
21
<footer>
32
<div class="row">
43
<div class="col-md-6" align="left">

_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: 14 additions & 14 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,21 +54,21 @@
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">
71-
<input type="text" id="google-search" placeholder="Search...">
71+
<input type="text" id="google-search" placeholder="Search..." aria-label="Google site search">
7272
</div>
7373
</form>
7474
</div>

_includes/syllabus.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Days are displayed if at least one episode has 'start = true'.
44
{% endcomment %}
55
<div class="syllabus">
6-
<h2>Schedule</h2>
6+
<h2 id="schedule">Schedule</h2>
77

88
{% assign day = 0 %}
99
{% assign multiday = false %}
@@ -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 %}
@@ -62,4 +62,9 @@ <h2>Schedule</h2>
6262
<td class="col-md-7"></td>
6363
</tr>
6464
</table>
65+
66+
<p>
67+
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
68+
</p>
69+
6570
</div>

_includes/workshop_footer.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<hr/>
21
<footer>
32
<div class="row">
43
<div class="col-md-6" align="left">

_layouts/base.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
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 "search-domain" used for google site search function google_search() -->
11+
<meta name="search-domain" value="{{ site.github.url }}">
12+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
13+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
14+
<link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
1415
{% if site.carpentry == "swc" %}
1516
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
1617
{% endif %}

_layouts/break.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: base
33
---
4-
{% include episode_title.html %}
4+
{% include episode_navbar.html episode_navbar_title=true %}
55
{% include episode_break.html %}
66
{{content}}
7+
{% include episode_navbar.html episode_navbar_title=false %}

_layouts/episode.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
layout: base
33
---
4-
{% include episode_title.html %}
4+
{% include episode_navbar.html episode_navbar_title=true %}
55
{% include episode_overview.html %}
66
{{content}}
77
{% include episode_keypoints.html %}
8+
{% include episode_navbar.html episode_navbar_title=false %}

_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 %}

bin/lesson_check.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ def check_config(reporter, source_dir):
155155
reporter.check_field(config_file, 'configuration', config, 'title')
156156
reporter.check_field(config_file, 'configuration', config, 'email')
157157

158+
reporter.check({'values': {'root': '..'}} in config.get('defaults', []),
159+
'configuration',
160+
'"root" not set to ".." in configuration')
161+
158162

159163
def read_all_markdown(source_dir, parser):
160164
"""Read source files, returning
@@ -424,6 +428,12 @@ def __init__(self, args, filename, metadata, metadata_len, text, lines, doc):
424428
super(CheckIndex, self).__init__(args, filename, metadata, metadata_len, text, lines, doc)
425429
self.layout = 'lesson'
426430

431+
def check_metadata(self):
432+
super(CheckIndex, self).check_metadata()
433+
self.reporter.check(self.metadata.get('root', '') == '.',
434+
self.filename,
435+
'Root not set to "."')
436+
427437

428438
class CheckEpisode(CheckBase):
429439
"""Check an episode page."""

bin/lesson_initialize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
# Surveys.
212212
pre_survey: "https://www.surveymonkey.com/r/swc_pre_workshop_v1?workshop_id="
213213
post_survey: "https://www.surveymonkey.com/r/swc_post_workshop_v1?workshop_id="
214+
training_post_survey: "https://www.surveymonkey.com/r/post-instructor-training"
214215
215216
# Start time in minutes (0 to be clock-independent, 540 to show a start at 09:00 am).
216217
start_time: 0
@@ -225,6 +226,8 @@
225226
226227
# Set the default layout for things in the episodes collection.
227228
defaults:
229+
- values:
230+
root: ..
228231
- scope:
229232
path: ""
230233
type: episodes
@@ -243,6 +246,7 @@
243246
ROOT_INDEX_MD = '''\
244247
---
245248
layout: lesson
249+
root: .
246250
---
247251
FIXME: home page introduction
248252
@@ -316,7 +320,7 @@
316320
EXTRAS_GUIDE_MD = '''\
317321
---
318322
layout: page
319-
title: "Instructors' Guide"
323+
title: "Instructor Notes"
320324
permalink: /guide/
321325
---
322326
FIXME

bin/markdown_ast.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Use Kramdown parser to produce AST for Markdown document.
44

55
require "kramdown"
6-
require "json"
6+
require "json"
77

88
markdown = STDIN.read()
99
doc = Kramdown::Document.new(markdown)

0 commit comments

Comments
 (0)