Skip to content

Commit d3148b4

Browse files
committed
Merge branch gh-pages of carpentries/styles
2 parents 9f16f44 + 487c4b8 commit d3148b4

29 files changed

Lines changed: 253 additions & 145 deletions

.github/ISSUE_TEMPLATE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Please delete the text below before submitting your contribution.
44

55
Thanks for contributing! If this contribution is for instructor training, please send an email to [email protected] with a link to this contribution so we can record your progress. You’ve completed your contribution step for instructor checkout just by submitting this contribution.
66

7+
If this issue is about a specific episode within a lesson, please provide its link or filename.
8+
79
Please keep in mind that lesson maintainers are volunteers and it may be some time before they can respond to your contribution. Although not all contributions can be incorporated into the lesson materials, we appreciate your time and effort to improve the curriculum. If you have any questions about the lesson maintenance process or would like to volunteer your time as a contribution reviewer, please contact Kate Hertweck ([email protected]).
810

911
---

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ root: .
55
---
66
## Instructional Material
77

8-
All Software Carpentry and Data Carpentry instructional material is
8+
All Software Carpentry, Data Carpentry, and Library Carpentry instructional material is
99
made available under the [Creative Commons Attribution
1010
license][cc-by-human]. The following is a human-readable summary of
1111
(and not a substitute for) the [full legal text of the CC BY 4.0

_includes/all_keypoints.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{% comment %}
22
Display key points of all episodes for reference.
33
{% endcomment %}
4+
5+
{% include base_path.html %}
6+
47
<h2>Key Points</h2>
58
<table class="table table-striped">
69
{% for episode in site.episodes %}
710
{% unless episode.break %}
811
<tr>
912
<td class="col-md-3">
10-
<a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
13+
<a href="{{ relative_root_path }}{{ episode.url }}">{{ episode.title }}</a>
1114
</td>
1215
<td class="col-md-9">
1316
<ul>

_includes/base_path.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{% comment %}
2+
This is adapted from: https://ricostacruz.com/til/relative-paths-in-jekyll
3+
4+
`page.url` gives the URL of the current page with a leading /:
5+
6+
- when the URL ends with the extension (e.g., /foo/bar.html) then we can get
7+
the depth by counting the number of / and remove - 1
8+
- when the URL ends with a / (e.g. /foo/bar/) then the number / gives the depth
9+
directly
10+
{% endcomment %}
11+
12+
{% assign relative_root_path = '' %}
13+
14+
{% assign last_char = page.url | slice: -1 %}
15+
16+
{% if last_char == "/"}
17+
{% assign offset = 0 %}
18+
{% else %}
19+
{% assign offset = 1 %}
20+
{% endif %}
21+
22+
{% assign depth = page.url | split: '/' | size | minus: offset %}
23+
{% if depth <= 1 %}{% assign relative_root_path = '.' %}
24+
{% elsif depth == 2 %}{% assign relative_root_path = '..' %}
25+
{% elsif depth == 3 %}{% assign relative_root_path = '../..' %}
26+
{% elsif depth == 4 %}{% assign relative_root_path = '../../..' %}
27+
{% endif %}

_includes/carpentries.html

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
{% comment %}
2-
General description of Software and Data Carpentry.
2+
General description of Software, Data, and Library Carpentry.
33
{% endcomment %}
4+
5+
{% include base_path.html %}
6+
47
<div class="row">
58
<div class="col-md-2" align="center">
6-
<a href="{{ site.carpentries_site }}"><img src="{{ page.root }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" /></a>
9+
<a href="{{ site.carpentries_site }}"><img src="{{ relative_root_path }}/assets/img/cp-logo-blue.svg" alt="The Carpentries logo" /></a>
710
</div>
811
<div class="col-md-8">
912
<p><a href="{{ site.carpentries_site }}">The Carpentries</a> comprises
10-
Software Carpentry and Data Carpentry, communities of Instructors, Trainers,
13+
Software Carpentry, Data Carpentry, and Library Carpentry communities of Instructors, Trainers,
1114
Maintainers, helpers, and supporters who share a mission to teach
12-
foundational coding and data science skills to researchers. In January,
15+
foundational coding and data science skills to researchers and people
16+
working in library- and information-related roles. In January,
1317
2018, The Carpentries was formed by the merger of Software Carpentry and
14-
Data Carpentry.</p>
18+
Data Carpentry. Library Carpentry became an official Carpentries Lesson Program in November 2018.</p>
1519

1620
<p>While individual lessons and workshops continue to be run under each
1721
lesson project, The Carpentries provide overall staffing and governance, as
@@ -23,7 +27,7 @@
2327
</div>
2428
<div class="row">
2529
<div class="col-md-2" align="center">
26-
<a href="{{ site.swc_site }}"><img src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
30+
<a href="{{ site.swc_site }}"><img src="{{ relative_root_path }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
2731
</div>
2832
<div class="col-md-8">
2933
<p>Since 1998, <a href="{{ site.swc_site }}">Software Carpentry</a> has
@@ -38,7 +42,7 @@
3842
<br/>
3943
<div class="row">
4044
<div class="col-md-2" align="center">
41-
<a href="{{ site.dc_site }}"><img src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
45+
<a href="{{ site.dc_site }}"><img src="{{ relative_root_path }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
4246
</div>
4347
<div class="col-md-8">
4448
<p><a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches
@@ -53,12 +57,10 @@
5357
<br/>
5458
<div class="row">
5559
<div class="col-md-2" align="center">
56-
<a href="{{ site.lc_site }}"><img src="{{ page.root }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
60+
<a href="{{ site.lc_site }}"><img src="{{ relative_root_path }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
5761
</div>
5862
<div class="col-md-8">
59-
<p><a href="{{ site.lc_site }}">Library Carpentry</a> is in discussions with
60-
The Carpentries to be a Lesson Project, like Software Carpentry*
61-
and Data Carpentry. Library Carpentry develops lessons and
63+
<p><a href="{{ site.lc_site }}">Library Carpentry</a> develops lessons and
6264
teaches workshops for and with people working in library- and
6365
information-related roles. Its goal is to create an on-ramp to empower this
6466
community to use software and data in their own work, as well as be

_includes/episode_navbar.html

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
1+
{% comment %}
2+
For some reason, the relative_root_path seems out of scope in this file, so we
3+
need to re-assign it here
4+
{% endcomment %}
5+
6+
{% include base_path.html %}
7+
18
{% comment %}
29
Navigation bar for an episode.
310
{% endcomment %}
11+
412
<div class="row">
513
<div class="col-xs-1">
614
<h3 class="text-left">
715
{% if page.previous.url %}
8-
<a href="{{ page.root }}{{ page.previous.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
16+
<a href="{{ relative_root_path }}{{ page.previous.url }}"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span><span class="sr-only">previous episode</span></a>
917
{% else %}
10-
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
18+
<a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
1119
{% endif %}
1220
</h3>
1321
</div>
1422
<div class="col-xs-10">
1523
{% if include.episode_navbar_title %}
16-
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
24+
<h3 class="maintitle"><a href="{{ relative_root_path }}/">{{ site.title }}</a></h3>
1725
{% endif %}
1826
</div>
1927
<div class="col-xs-1">
2028
<h3 class="text-right">
2129
{% if page.next.url %}
22-
<a href="{{ page.root }}{{ page.next.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
30+
<a href="{{ relative_root_path }}{{ page.next.url }}"><span class="glyphicon glyphicon-menu-right" aria-hidden="true"></span><span class="sr-only">next episode</span></a>
2331
{% else %}
24-
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
32+
<a href="{{ relative_root_path }}/"><span class="glyphicon glyphicon-menu-up" aria-hidden="true"></span><span class="sr-only">lesson home</span></a>
2533
{% endif %}
2634
</h3>
2735
</div>

_includes/favicons.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% assign favicon_url = site.baseurl | append: '/assets/favicons/' | append: site.carpentry | prepend: site.url %}
1+
{% assign favicon_url = relative_root_path | append: '/assets/favicons/' | append: site.carpentry %}
22

33
{% if site.carpentry == 'swc' %}
44
{% assign carpentry = 'Software Carpentry' %}

_includes/gh_variables.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{% comment %}
2+
When rendering websites locally, `site.github.url` doesn't get resolved properly
3+
unless a GitHub Personal Access Token is set up and available in the
4+
environment. This leads to warnings and errors when trying to serve the site
5+
locally. To work around this, we use the `jekyll.environment` variable which is
6+
set to `development` when rendering the site locally, and set to `production` on
7+
GitHub where `site.github.url` is defined.
8+
{% endcomment %}
9+
10+
{% if jekyll.environment == "production" %}
11+
12+
{% comment %}
13+
First, get the name of the repository
14+
{% endcomment %}
15+
{% assign repo_name = site.github.repository_name %}
16+
17+
{% comment %}
18+
`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part
19+
of the metadata that is relevant to the present repository.
20+
{% endcomment %}
21+
{% assign repo_info = site.github.public_repositories | where: "name", repo_name %}
22+
23+
{% comment %}
24+
Now, we can extract the default branch for the repo
25+
{% endcomment %}
26+
{% assign default_branch = repo_info[0].default_branch %}
27+
28+
{% comment %}
29+
Other variables requested by the template
30+
{% endcomment %}
31+
{% assign repo_url = site.github.repository_url %}
32+
{% assign search_domain_url = site.github.url %}
33+
{% assign project_title = site.github.project_title %}
34+
{% assign source_branch = site.github.source.branch %}
35+
36+
{% elsif jekyll.environment == "development" %}
37+
38+
{% assign repo_name = "" %}
39+
{% assign repo_url = "" %}
40+
{% assign default_branch = "" %}
41+
{% assign search_domain_url = "" %}
42+
{% assign project_title = "" %}
43+
{% assign source_branch = "" %}
44+
45+
{% endif %}

_includes/javascript.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{% comment %}
2-
Javascript used in lesson and workshop pages.
2+
JavaScript used in lesson and workshop pages.
33
{% endcomment %}
4-
<script src="{{ page.root }}/assets/js/jquery.min.js"></script>
5-
<script src="{{ page.root }}/assets/js/bootstrap.min.js"></script>
6-
<script src="{{ page.root }}/assets/js/lesson.js"></script>
4+
<script src="{{ relative_root_path }}/assets/js/jquery.min.js"></script>
5+
<script src="{{ relative_root_path }}/assets/js/bootstrap.min.js"></script>
6+
<script src="{{ relative_root_path }}/assets/js/lesson.js"></script>
77
<script>
88
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
99
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

_includes/lc/intro.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<p>
22
<a href="{{site.lc_site}}">Library Carpentry</a>
3-
is made by librarians, for librarians to help you:
3+
is made by people working in library- and information-related roles to help you:
44
</p>
55
<ul>
66
<li>automate repetitive, boring, error-prone tasks</li>
7-
<li>create, maintain and analyse sustainable and reusable data</li>
7+
<li>create, maintain and analyze sustainable and reusable data</li>
88
<li>work effectively with IT and systems colleagues</li>
99
<li>better understand the use of software in research</li>
1010
<li>and much more...</li>

0 commit comments

Comments
 (0)