Skip to content

Commit

Permalink
Merge remote-tracking branch 'styles/gh-pages' into gh-pages
Browse files Browse the repository at this point in the history
Conflicts:
	_includes/links.md
  • Loading branch information
maxim-belkin committed Dec 7, 2018
2 parents 96903ca + 487c4b8 commit cf772f1
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Please delete the text below before submitting your contribution.

Thanks for contributing! If this contribution is for instructor training, please send an email to checkout@carpentries.org 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.

If this issue is about a specific episode within a lesson, please provide its link or filename.

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 (k8hertweck@gmail.com).

---
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Licenses"
---
## Instructional Material

All Software Carpentry and Data Carpentry instructional material is
All Software Carpentry, Data Carpentry, and Library Carpentry instructional material is
made available under the [Creative Commons Attribution
license][cc-by-human]. The following is a human-readable summary of
(and not a substitute for) the [full legal text of the CC BY 4.0
Expand Down
13 changes: 6 additions & 7 deletions _includes/carpentries.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% comment %}
General description of Software and Data Carpentry.
General description of Software, Data, and Library Carpentry.
{% endcomment %}

{% include base_path.html %}
Expand All @@ -10,11 +10,12 @@
</div>
<div class="col-md-8">
<p><a href="{{ site.carpentries_site }}">The Carpentries</a> comprises
Software Carpentry and Data Carpentry, communities of Instructors, Trainers,
Software Carpentry, Data Carpentry, and Library Carpentry communities of Instructors, Trainers,
Maintainers, helpers, and supporters who share a mission to teach
foundational coding and data science skills to researchers. In January,
foundational coding and data science skills to researchers and people
working in library- and information-related roles. In January,
2018, The Carpentries was formed by the merger of Software Carpentry and
Data Carpentry.</p>
Data Carpentry. Library Carpentry became an official Carpentries Lesson Program in November 2018.</p>

<p>While individual lessons and workshops continue to be run under each
lesson project, The Carpentries provide overall staffing and governance, as
Expand Down Expand Up @@ -59,9 +60,7 @@
<a href="{{ site.lc_site }}"><img src="{{ relative_root_path }}/assets/img/lc-icon-black.png" alt="Library Carpentry logo" /></a>
</div>
<div class="col-md-8">
<p><a href="{{ site.lc_site }}">Library Carpentry</a> is in discussions with
The Carpentries to be a Lesson Project, like Software Carpentry*
and Data Carpentry. Library Carpentry develops lessons and
<p><a href="{{ site.lc_site }}">Library Carpentry</a> develops lessons and
teaches workshops for and with people working in library- and
information-related roles. Its goal is to create an on-ramp to empower this
community to use software and data in their own work, as well as be
Expand Down
45 changes: 45 additions & 0 deletions _includes/gh_variables.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% comment %}
When rendering websites locally, `site.github.url` doesn't get resolved properly
unless a GitHub Personal Access Token is set up and available in the
environment. This leads to warnings and errors when trying to serve the site
locally. To work around this, we use the `jekyll.environment` variable which is
set to `development` when rendering the site locally, and set to `production` on
GitHub where `site.github.url` is defined.
{% endcomment %}

{% if jekyll.environment == "production" %}

{% comment %}
First, get the name of the repository
{% endcomment %}
{% assign repo_name = site.github.repository_name %}

{% comment %}
`site.github.public_repositories` contains comprehensive information for all public repositories for the organization. We use `where` to extract the part
of the metadata that is relevant to the present repository.
{% endcomment %}
{% assign repo_info = site.github.public_repositories | where: "name", repo_name %}

{% comment %}
Now, we can extract the default branch for the repo
{% endcomment %}
{% assign default_branch = repo_info[0].default_branch %}

{% comment %}
Other variables requested by the template
{% endcomment %}
{% assign repo_url = site.github.repository_url %}
{% assign search_domain_url = site.github.url %}
{% assign project_title = site.github.project_title %}
{% assign source_branch = site.github.source.branch %}

{% elsif jekyll.environment == "development" %}

{% assign repo_name = "" %}
{% assign repo_url = "" %}
{% assign default_branch = "" %}
{% assign search_domain_url = "" %}
{% assign project_title = "" %}
{% assign source_branch = "" %}

{% endif %}
2 changes: 1 addition & 1 deletion _includes/lc/intro.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>
<a href="{{site.lc_site}}">Library Carpentry</a>
is made by librarians, for librarians to help you:
is made by people working in library- and information-related roles to help you:
</p>
<ul>
<li>automate repetitive, boring, error-prone tasks</li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/lc/who.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p id="who">
<strong>Who:</strong>
The course is for librarians, archivists, and other information workers.
The course is for people working in library- and information-related roles.
<strong>
You don't need to have any previous knowledge of the tools that
will be presented at the workshop.
Expand Down
13 changes: 8 additions & 5 deletions _includes/lesson_footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% comment %}
Footer for lesson pages.
{% endcomment %}

{% include gh_variables.html %}

<footer>
<div class="row">
<div class="col-md-6 copyright" align="left">
Expand All @@ -27,17 +30,17 @@
<div class="col-md-6 help-links" align="right">
{% if page.source %}
{% if page.source == "Rmd" %}
<a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Edit on GitHub</a>
{% endif %}
{% else %}
<a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Edit on GitHub</a>
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}">Edit on GitHub</a>
{% endif %}
/
<a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
<a href="{{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md">Contributing</a>
/
<a href="{{ site.github.repository_url }}/">Source</a>
<a href="{{ repo_url }}/">Source</a>
/
<a href="{{ site.github.repository_url }}/blob/gh-pages/CITATION">Cite</a>
<a href="{{ repo_url }}/blob/{{ source_branch }}/CITATION">Cite</a>
/
<a href="mailto:{{ site.email }}">Contact</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions _includes/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[coc]: https://docs.carpentries.org/topic_folders/policies/code-of-conduct.html
[concept-maps]: https://carpentries.github.io/instructor-training/05-memory/
[contrib-covenant]: https://contributor-covenant.org/
[contributing]: {{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md
[contributing]: {{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md
[cran-checkpoint]: https://cran.r-project.org/package=checkpoint
[cran-knitr]: https://cran.r-project.org/package=knitr
[cran-stringr]: https://cran.r-project.org/package=stringr
Expand All @@ -19,7 +19,7 @@
[jekyll]: https://jekyllrb.com/
[jupyter]: https://jupyter.org/
[kramdown]: https://kramdown.gettalong.org/
[lc-lessons]: https://librarycarpentry.org/#portfolio
[lc-lessons]: https://librarycarpentry.org/lessons/
[lesson-example]: https://carpentries.github.io/lesson-example/
[mit-license]: https://opensource.org/licenses/mit-license.html
[morea]: https://morea-framework.github.io/
Expand All @@ -35,7 +35,7 @@
[ruby-installer]: https://rubyinstaller.org/
[rubygems]: https://rubygems.org/pages/download/
[styles]: https://github.com/carpentries/styles/
[swc-lessons]: https://software-carpentry.org/lessons/
[swc-lessons]: https://software-carpentry.org/lessons/
[swc-releases]: https://github.com/swcarpentry/swc-releases
[training]: https://carpentries.github.io/instructor-training/
[workshop-repo]: {{ site.workshop_repo }}
Expand Down
7 changes: 5 additions & 2 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% comment %}
Lesson navigation bar.
{% endcomment %}

{% include gh_variables.html %}

<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
Expand Down Expand Up @@ -74,10 +77,10 @@
<li><a href="{{ relative_root_path }}{% link LICENSE.md %}">License</a></li>
{% if page.source %}
{% if page.source == "Rmd" %}
<li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
<li><a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
{% endif %}
{% else %}
<li><a href="{{site.github.repository_url}}/edit/gh-pages/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
<li><a href="{{repo_url}}/edit/{{ default_branch}}/{{page.path}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
{% endif %}
</ul>
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
Expand Down
2 changes: 1 addition & 1 deletion _includes/workshop_calendar.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="//calendar.google.com/calendar/render?action=TEMPLATE&text={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop&dates={{ page.startdate | replace: "-", "" }}/{{ page.enddate | replace: "-", "" | plus: 0}}&trp=false&sprop&sprop=name:&sf=true&output=xml&location={{ page.address }}&details={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop at {{ page.venue }}">Add to your Google Calendar.</a>
<a href="//calendar.google.com/calendar/render?action=TEMPLATE&text={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "lc" %}Library{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop&dates={{ page.startdate | replace: "-", "" }}/{{ page.enddate | replace: "-", "" | plus: 0}}&trp=false&sprop&sprop=name:&sf=true&output=xml&location={{ page.address }}&details={% if page.carpentry == "swc" %}Software{% elsif page.carpentry == "lc" %}Library{% elsif page.carpentry == "dc" %}Data{% endif %} Carpentry Workshop at {{ page.venue }}">Add to your Google Calendar.</a>
2 changes: 1 addition & 1 deletion _includes/workshop_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4>
</div>
<div class="col-md-6" align="right">
<h4>
<a href="mailto:{{ site.email }}">Contact</a>
<a href="mailto:{{ site.email }}">Contact The Carpentries</a>
</h4>
</div>
</div>
Expand Down
16 changes: 1 addition & 15 deletions _layouts/base.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
---
---
{% comment %}
When rendering websites locally, `site.github.url` doesn't get resolved
properly unless GitHub PAT are set up and available in the environment.
This leads to warnings and errors when trying to serve the site locally.
To work around this, we use the `jekyll.environment` variable which is set to
`development` when rendering the site locally, and set to `production` on
GitHub where `site.github.url` will be defined.
{% endcomment %}

{% if jekyll.environment == "development" %}
{% assign search_domain_url = "" %}
{% elsif jekyll.environment == "production" %}
{% assign search_domain_url = site.github.url %}
{% endif %}

{% include base_path.html %}
{% include gh_variables.html %}

<!doctype html>
<html lang="en">
Expand Down
5 changes: 3 additions & 2 deletions _layouts/workshop.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
---

{% include base_path.html %}
{% include gh_variables.html %}

<!doctype html>
<html lang="en">
<head>

<meta name="slug" content="{{site.github.project_title}}" />
<meta name="slug" content="{{project_title}}" />
<meta name="startdate" content="{{page.startdate}}" />
<meta name="enddate" content="{{page.enddate}}" />
<meta name="humandate" content="{{page.humandate}}" />
Expand All @@ -20,6 +20,7 @@
<meta name="instructor" content="{{page.instructor|join:'|'}}" />
<meta name="helper" content="{{page.helper|join:'|'}}" />
<meta name="contact" content="{{page.email}}" />
<meta name="carpentry" content="{{site.carpentry}}"
{% if page.redirect %}
<meta http-equiv="refresh" content="0; url={{page.redirect}}" />
{% endif %}
Expand Down
11 changes: 7 additions & 4 deletions bin/boilerplate/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

[Software Carpentry][swc-site] and [Data Carpentry][dc-site] are open source projects,
[The Carpentries][c-site] ([Software Carpentry][swc-site], [Data Carpentry][dc-site], and [Library Carpentry][lc-site]) are open source projects,
and we welcome contributions of all kinds:
new lessons,
fixes to existing material,
Expand All @@ -14,7 +14,7 @@ you agree that we may redistribute your work under [our license](LICENSE.md).
In exchange,
we will address your issues and/or assess your change proposal as promptly as we can,
and help you become a member of our community.
Everyone involved in [Software Carpentry][swc-site] and [Data Carpentry][dc-site]
Everyone involved in [The Carpentries][c-site]
agrees to abide by our [code of conduct](CODE_OF_CONDUCT.md).

## How to Contribute
Expand Down Expand Up @@ -73,8 +73,8 @@ and submitting [bug reports][issues]
about things that don't work, aren't clear, or are missing.
If you are looking for ideas, please see the 'Issues' tab for
a list of issues associated with this repository,
or you may also look at the issues for [Data Carpentry][dc-issues]
and [Software Carpentry][swc-issues] projects.
or you may also look at the issues for [Data Carpentry][dc-issues],
[Software Carpentry][swc-issues], and [Library Carpentry][lc-issues] projects.

Comments on issues and reviews of pull requests are just as welcome:
we are smarter together than we are on our own.
Expand Down Expand Up @@ -146,3 +146,6 @@ You can also [reach us by email][email].
[swc-issues]: https://github.com/issues?q=user%3Aswcarpentry
[swc-lessons]: https://software-carpentry.org/lessons/
[swc-site]: https://software-carpentry.org/
[c-site]: https://carpentries.org/
[lc-site]: https://librarycarpentry.org/
[lc-issues]: https://github.com/issues?q=user%3Alibrarycarpentry
5 changes: 3 additions & 2 deletions bin/boilerplate/_episodes/01-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ exercises: 0
questions:
- "Key question (FIXME)"
objectives:
- "First objective. (FIXME)"
- "First learning objective. (FIXME)"
keypoints:
- "First key point. (FIXME)"
- "First key point. Brief Answer to questions. (FIXME)"
---
FIXME

{% include links.md %}

16 changes: 8 additions & 8 deletions bin/boilerplate/aio.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
xmlHttp[i] = new XMLHttpRequest();
xmlHttp[i].episode = lesson_episodes[i]; /* To enable use this later. */
xmlHttp[i].onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var article_here = document.getElementById(this.episode);
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
article_here.innerHTML = htmlDocArticle.innerHTML;
if (this.readyState == 4 && this.status == 200) {
var article_here = document.getElementById(this.episode);
var parser = new DOMParser();
var htmlDoc = parser.parseFromString(this.responseText,"text/html");
var htmlDocArticle = htmlDoc.getElementsByTagName("article")[0];
article_here.innerHTML = htmlDocArticle.innerHTML;
}
}
episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
var episode_url = "{{ relative_root_path }}" + lesson_episodes[i];
xmlHttp[i].open("GET", episode_url);
xmlHttp[i].send(null);
}
}
</script>
{% comment %}
Create anchor for each one of the episodes.
Create an anchor for every episode.
{% endcomment %}
{% for episode in site.episodes %}
<article id="{{ episode.url }}"></article>
Expand Down
8 changes: 6 additions & 2 deletions bin/boilerplate/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
layout: lesson
root: . # Is the only page that don't follow the partner /:path/index.html
permalink: index.html # Is the only page that don't follow the partner /:path/index.html
root: . # Is the only page that doesn't follow the pattern /:path/index.html
permalink: index.html # Is the only page that doesn't follow the pattern /:path/index.html
---
FIXME: home page introduction

<!-- this is an html comment -->

{% comment %} This is a comment in Liquid {% endcomment %}

> ## Prerequisites
>
> FIXME
Expand Down
8 changes: 4 additions & 4 deletions bin/workshop_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
URL_PATTERN = r'https?://.+'

# Defaults.
CARPENTRIES = ("dc", "swc")
CARPENTRIES = ("dc", "swc", "lc", "cp")
DEFAULT_CONTACT_EMAIL = 'admin@software-carpentry.org'

USAGE = 'Usage: "workshop_check.py path/to/root/directory"'
Expand Down Expand Up @@ -91,7 +91,7 @@ def check_layout(layout):

@look_for_fixme
def check_carpentry(layout):
'''"carpentry" in YAML header must be "dc" or "swc".'''
'''"carpentry" in YAML header must be "dc", "swc", "lc", or "cp".'''

return layout in CARPENTRIES

Expand All @@ -117,7 +117,7 @@ def check_humandate(date):
and 4-digit year. Examples include 'Feb 18-20, 2025' and 'Feb 18
and 20, 2025'. It may be in languages other than English, but the
month name should be kept short to aid formatting of the main
Software Carpentry web site.
Carpentries web site.
"""

if ',' not in date:
Expand Down Expand Up @@ -390,7 +390,7 @@ def check_config(reporter, filename):
kind)

carpentry = config.get('carpentry', None)
reporter.check(carpentry in ('swc', 'dc'),
reporter.check(carpentry in ('swc', 'dc', 'lc', 'cp'),
filename,
'Missing or unknown carpentry: {0}',
carpentry)
Expand Down

0 comments on commit cf772f1

Please sign in to comment.