Skip to content

Commit 95a59c4

Browse files
authored
Merge pull request #274 from LibraryCarpentry/update-styles-final
Update to final version of styles lesson template
2 parents 72c845a + 43b06bd commit 95a59c4

File tree

6 files changed

+107
-15
lines changed

6 files changed

+107
-15
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{% assign date = include.need_transition_date %}
2+
3+
{% if date == "true" %}
4+
{% unless site.transition_date_prebeta %}
5+
<div class="alert alert-danger">
6+
you need to specify the variable <code>transition_date_prebeta</code>
7+
in <code>_config.yml</code>.
8+
</div>
9+
{% endunless %}
10+
{% unless site.transition_date_beta %}
11+
<div class="alert alert-danger">
12+
you need to specify the variable <code>transition_date_beta</code>
13+
in <code>_config.yml</code>.
14+
</div>
15+
{% endunless %}
16+
{% unless site.transition_date_prerelease %}
17+
<div class="alert alert-danger">
18+
you need to specify the variable <code>transition_date_prerelease</code>
19+
in <code>_config.yml</code>.
20+
</div>
21+
{% endunless %}
22+
{% endif %}

_includes/lesson_footer.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@
2828
{% endif %}
2929
</div>
3030
<div class="col-md-6 help-links" align="right">
31-
{% if page.source %}
32-
{% if page.source == "Rmd" %}
33-
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
34-
{% endif %}
35-
{% else %}
36-
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit on GitHub</a>
37-
{% endif %}
31+
{% if site.life_cycle == 'transition-step-2' %}
32+
{% assign edit_url = "https://carpentries.github.io/workbench/contributor/beta.html?id=" | append: repo_url %}
33+
{% else %}
34+
{% assign edit_url = repo_url %}
35+
{% endif %}
36+
{% if page.source == "Rmd" %}
37+
<a href="{{edit_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
38+
{% else %}
39+
<a href="{{edit_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit on GitHub</a>
40+
{% endif %}
3841
/
3942
<a href="{{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md" data-checker-ignore>Contributing</a>
4043
/

_includes/life_cycle.html

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,55 @@
2828
{% elsif site.life_cycle == "stable" %}
2929

3030
{% comment %}
31-
We do not do anything special unless this is a Carpentries Lab lesson
31+
We do not do anything special for lessons in stable
32+
{% endcomment %}
33+
34+
35+
{% comment %}
36+
Below we cover the 2 phases of lesson transition towards the Carpentries Workbench:
37+
Variables needed:
38+
- transition_date_prebeta: the date of the prebeta stage
39+
- transition_date_beta: the date of the beta stage
40+
- transition_date_prerelease: the date of the prerelease stage
41+
42+
- transition-step-1: We notify that there is a snapshot of the lesson available for testing, and that it will supersede this version.
43+
- transition-step-2 We indicate that this version of the lesson is a snapshot and a new version of the lesson is avaiable and will supersede this version at a given date.
44+
{% endcomment %}
45+
46+
{% elsif site.life_cycle == "transition-step-1" %}
47+
{% include check_transition_variables.html need_transition_date = 'true' %}
48+
49+
<div id="life-cycle" class="alert alert-warning life-cycle panel-body">
50+
A snapshot of this lesson from {{ site.transition_date_prebeta }} is being tested on
51+
<a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
52+
<a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
53+
<br>
54+
<b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
55+
<button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
56+
<span aria-hidden="true" style='font-size:34pt'>&times;</span>
57+
</button>
58+
</div>
59+
60+
{% elsif site.life_cycle == "transition-step-2" %}
61+
{% include check_transition_variables.html need_transition_date = 'true' %}
62+
63+
<div id="life-cycle" class="alert alert-danger alert-dismissible life-cycle panel-body" role="alert">
64+
This lesson is a <b>snapshot from {{ site.transition_date_beta }}</b>.
65+
A newer version is being tested on <a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
66+
<a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
67+
<br>
68+
<b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
69+
<button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
70+
<span aria-hidden="true" style='font-size:34pt'>&times;</span>
71+
</button>
72+
</div>
73+
74+
{% endif %}
75+
76+
77+
78+
{% comment %}
79+
For Carpentries Lab lessons we add a banner about the review status
3280
{% endcomment %}
3381

3482
{% if site.carpentry == "lab" %}
@@ -43,4 +91,3 @@
4391
</div>
4492
</div>
4593
{% endif %}
46-
{% endif %}

_includes/navbar.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,16 @@
9494

9595
{% comment %} Always show license. {% endcomment %}
9696
<li><a href="{{ relative_root_path }}{% link LICENSE.md %}">License</a></li>
97-
{% if page.source %}
98-
{% if page.source == "Rmd" %}
99-
<li><a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
100-
{% endif %}
97+
{% if site.life_cycle == 'transition-step-2' %}
98+
{% assign edit_url = "https://carpentries.github.io/workbench/contributor/beta.html?id=" | append: repo_url %}
99+
{% else %}
100+
{% assign edit_url = repo_url %}
101+
{% endif %}
102+
103+
{% if page.source == "Rmd" %}
104+
<li><a href="{{edit_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
101105
{% else %}
102-
<li><a href="{{repo_url}}/edit/{{ default_branch}}/{{page.path}}" data-checker-ignore>Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
106+
<li><a href="{{edit_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
103107
{% endif %}
104108
</ul>
105109
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">

_layouts/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<title>
3434
{% if page.title %}{{ page.title }}{% endif %}{% if page.title and site.title %} &ndash; {% endif %}{% if site.title %}{{ site.title }}{% endif %}
35-
</title>
35+
</title>
3636

3737
</head>
3838
<body>

bin/boilerplate/_config.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,24 @@ title: "Lesson Title"
1616
# Life cycle stage of the lesson
1717
# See this page for more details: https://cdh.carpentries.org/the-lesson-life-cycle.html
1818
# Possible values: "pre-alpha", "alpha", "beta", "stable"
19+
#
20+
# Lessons that are going through the transition to the
21+
# Carpentries Workbench will go through 3 steps:
22+
# 'transition-step-1': notice indicating a new version
23+
# 'transition-step-2': notice encouraging to use new version
24+
# 'transition-step-3': notice indicating the lesson is deprecated,
25+
# with automated redirect
1926
life_cycle: "pre-alpha"
2027

28+
# For lessons in the life stages in 'transition-step-1' or later:
29+
# - 'transition_url' holds the URL for the version of the lesson that
30+
# uses the Workbench (needed for all 3 steps)
31+
# - 'transition_date' (in yyyy-mm-dd format) is the date when the lesson
32+
# will transition to being deprecated. The date only needs to be decided
33+
# when the lesson is in 'transition-step-2'.
34+
transition_url:
35+
transition_date:
36+
2137
#------------------------------------------------------------
2238
# Generic settings (should not need to change).
2339
#------------------------------------------------------------

0 commit comments

Comments
 (0)