Skip to content

Commit

Permalink
Merge pull request #639 from carpentries/update-transition-workflow
Browse files Browse the repository at this point in the history
modify transition workflow/variables
  • Loading branch information
zkamvar authored Oct 14, 2022
2 parents 078eec5 + 07553b2 commit 6b8bbad
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 41 deletions.
17 changes: 11 additions & 6 deletions _includes/check_transition_variables.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{% assign date = include.need_transition_date %}

{% unless site.transition_url %}
{% if date == "true" %}
{% unless site.transition_date_prebeta %}
<div class="alert alert-danger">
you need to specify the variable <code>transition_url</code>
you need to specify the variable <code>transition_date_prebeta</code>
in <code>_config.yml</code>.
</div>
{% endunless %}

{% if date == "true" %}
{% unless site.transition_date %}
{% unless site.transition_date_beta %}
<div class="alert alert-danger">
you need to specify the variable <code>transition_date_beta</code>
in <code>_config.yml</code>.
</div>
{% endunless %}
{% unless site.transition_date_prerelease %}
<div class="alert alert-danger">
you need to specify the variable <code>transition_date</code>
you need to specify the variable <code>transition_date_prerelease</code>
in <code>_config.yml</code>.
</div>
{% endunless %}
Expand Down
14 changes: 7 additions & 7 deletions _includes/lesson_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
{% endif %}
</div>
<div class="col-md-6 help-links" align="right">
{% if site.life_cycle contains 'transition-step' %}
<a href="{{repo_url}}">Edit on GitHub</a>
{% elsif page.source == "Rmd" %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
{% else %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit on GitHub</a>
{% endif %}
{% if site.life_cycle == 'transition-step-2' %}
<a href="{{repo_url}}">Edit on GitHub</a>
{% elsif page.source == "Rmd" %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
{% else %}
<a href="{{repo_url}}/edit/{{ default_branch }}/{{page.path}}" data-checker-ignore>Edit on GitHub</a>
{% endif %}
/
<a href="{{ repo_url }}/blob/{{ source_branch }}/CONTRIBUTING.md" data-checker-ignore>Contributing</a>
/
Expand Down
49 changes: 26 additions & 23 deletions _includes/life_cycle.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,42 @@


{% comment %}
Below we cover the 3 phases of lesson transition towards the Carpentries Workbench:
- transition-step-1 (`transition_url` variable needed): we indicate that there
is a new version of the lesson that is available for testing, and that it will be deprecated in the future.
- transition-step-2 (`transition_url` and `transition_date` variables needed): we indicate that a new version of the lesson is avaiable with a deprecation date.
- transition-step-3 (`transition_url` variable needed): the lesson is fully deprecated, and a redirect is set up to the new URL
Below we cover the 2 phases of lesson transition towards the Carpentries Workbench:
Variables needed:
- transition_date_prebeta: the date of the prebeta stage
- transition_date_beta: the date of the beta stage
- transition_date_prerelease: the date of the prerelease stage

- transition-step-1: We notify that there is a snapshot of the lesson available for testing, and that it will supersede this version.
- 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.
{% endcomment %}

{% elsif site.life_cycle == "transition-step-1" %}
{% include check_transition_variables.html need_transition_date = 'false' %}
{% include check_transition_variables.html need_transition_date = 'true' %}

<div class="alert alert-warning life-cycle">
A newer version of this lesson is being tested on The Carpentries Workbench:
<a href="{{ site.transition_url }}">{{ site.transition_url }}</a>.
The Jekyll version of this lesson will become deprecated in the near future.
A snapshot of this lesson from {{ site.transition_date_prebeta }} is being tested on
<a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
<a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
<br>
<b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
<button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true" style='font-size:34pt'>&times;</span>
</button>
</div>

{% elsif site.life_cycle == "transition-step-2" %}
{% include check_transition_variables.html need_transition_date = 'true' %}

<div class="alert alert-danger life-cycle">
A newer version of this lesson is available from:
<a href="{{ site.transition_url }}">{{ site.transition_url }}</a>.
The Jekyll version of this lesson will become deprecated on
{{ site.transition_date }}.
</div>

{% elsif site.life_cycle == "transition-step-3" %}
{% include check_transition_variables.html need_transition_date = 'false' %}

<div class="alert alert-danger life-cycle">
You are veiwing a deprecated version of this lesson. An updated version is
available from:
<a href="{{ site.transition_url }}">{{ site.transition_url }}</a>.
<div class="alert alert-danger alert-dismissible life-cycle" role="alert">
This lesson is a <b>snapshot from {{ site.transition_date_beta }}</b>.
A newer version is being tested on <a href='https://carpentries.github.io/workbench'>The Carpentries Workbench</a>:
<a href="https://preview.carpentries.org/{{ repo_name }}">https://preview.carpentries.org/{{ repo_name }}</a>.
<br>
<b>The Workbench version of this lesson will become default on {{ site.transition_date_prerelease }}</b>.
<button type="button" style="border: true; position: absolute; top: 10px; right: 27px; color: #383838;" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true" style='font-size:34pt'>&times;</span>
</button>
</div>

{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

{% comment %} Always show license. {% endcomment %}
<li><a href="{{ relative_root_path }}{% link LICENSE.md %}">License</a></li>
{% if site.life_cycle contains 'transition-step' %}
{% if site.life_cycle == 'transition-step-1' %}
<li><a href="{{repo_url}}">Improve this page <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a></li>
{% elsif page.source == "Rmd" %}
<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>
Expand Down
4 changes: 0 additions & 4 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

{% include favicons.html %}

{% if site.life_cycle == 'transition-step-3' %}
<meta http-equiv="refresh" content="0; url={{ site.transition_url }}" />
{% endif %}

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
Expand Down

0 comments on commit 6b8bbad

Please sign in to comment.