Skip to content

Commit

Permalink
Merge pull request #1376 from swcarpentry/update-styles-final
Browse files Browse the repository at this point in the history
Update to final version of styles lesson template
  • Loading branch information
bkmgit authored Apr 20, 2023
2 parents 71e4e67 + 9e1d809 commit f5a43c0
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Thanks for contributing! :heart:

If this contribution is for instructor training, please email the link to this contribution to
checkout@carpentries.org so we can record your progress. You've completed your contribution
instructor.training@carpentries.org so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
Expand Down
20 changes: 11 additions & 9 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ license terms.

Under the following terms:

* **Attribution**---You must give appropriate credit (mentioning that
your work is derived from work that is Copyright © Software
Carpentry and, where practical, linking to
http://software-carpentry.org/), provide a [link to the
license][cc-by-human], and indicate if changes were made. You may do
so in any reasonable manner, but not in any way that suggests the
licensor endorses you or your use.
* **Attribution**---You must give appropriate credit by:
- mentioning that your work is derived from work that is
Copyright © Software Carpentry, Data Carpentry, Library Carpentry,
or The Carpentries.
- where practical, linking to the respective lesson program website
(https://software-carpentry.org/, https://datacarpentry.org, https://librarycarpentry.org, or
https://carpentries.org), provide a [link to the license][cc-by-human]
- and indicate if changes were made. You may do so in any reasonable manner, but not in any way
that suggests the licensor endorses you or your use.

**No additional restrictions**---You may not apply legal terms or
technological measures that legally restrict others from doing
Expand Down Expand Up @@ -73,8 +75,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Trademark

"Software Carpentry" and "Data Carpentry" and their respective logos
are registered trademarks of [Community Initiatives][CI].
"The Carpentries", "Software Carpentry" and "Data Carpentry" and their respective logos are
registered trademarks of [Community Initiatives][CI].

[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
Expand Down
22 changes: 22 additions & 0 deletions _includes/check_transition_variables.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% assign date = include.need_transition_date %}

{% if date == "true" %}
{% unless site.transition_date_prebeta %}
<div class="alert alert-danger">
you need to specify the variable <code>transition_date_prebeta</code>
in <code>_config.yml</code>.
</div>
{% endunless %}
{% 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_prerelease</code>
in <code>_config.yml</code>.
</div>
{% endunless %}
{% endif %}
25 changes: 19 additions & 6 deletions _includes/javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@
<script src="{{ relative_root_path }}/assets/js/bootstrap.min.js"></script>
<script src="{{ relative_root_path }}/assets/js/lesson.js"></script>

{% if site.kind == "lesson" %}
<!-- Matomo -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37305346-2', 'auto');
ga('send', 'pageview');
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.lessons.carpentries.org","*.datacarpentry.github.io","*.datacarpentry.org","*.librarycarpentry.github.io","*.librarycarpentry.org","*.swcarpentry.github.io"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://carpentries.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='//cdn.matomo.cloud/carpentries.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
{% endif %}

{% if page.math %}
<script src="{{ relative_root_path }}/assets/js/katex.min.js"></script>
Expand Down
17 changes: 10 additions & 7 deletions _includes/lesson_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@
{% endif %}
</div>
<div class="col-md-6 help-links" align="right">
{% if page.source %}
{% if 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>
{% endif %}
{% 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' %}
{% assign edit_url = "https://carpentries.github.io/workbench/contributor/beta.html?id=" | append: repo_url %}
{% else %}
{% assign edit_url = repo_url %}
{% endif %}
{% if page.source == "Rmd" %}
<a href="{{edit_url}}/edit/{{ default_branch }}/{{page.path|replace: "_episodes", "_episodes_rmd" | replace: ".md", ".Rmd"}}" data-checker-ignore>Edit on GitHub</a>
{% else %}
<a href="{{edit_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
51 changes: 49 additions & 2 deletions _includes/life_cycle.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,55 @@
{% elsif site.life_cycle == "stable" %}

{% comment %}
We do not do anything special unless this is a Carpentries Lab lesson
We do not do anything special for lessons in stable
{% endcomment %}


{% comment %}
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 = 'true' %}

<div id="life-cycle" class="alert alert-warning life-cycle panel-body">
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 id="life-cycle" class="alert alert-danger alert-dismissible life-cycle panel-body" 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 %}



{% comment %}
For Carpentries Lab lessons we add a banner about the review status
{% endcomment %}

{% if site.carpentry == "lab" %}
Expand All @@ -43,4 +91,3 @@
</div>
</div>
{% endif %}
{% endif %}
14 changes: 9 additions & 5 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@

{% comment %} Always show license. {% endcomment %}
<li><a href="{{ relative_root_path }}{% link LICENSE.md %}">License</a></li>
{% if page.source %}
{% if 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>
{% endif %}
{% if site.life_cycle == 'transition-step-2' %}
{% assign edit_url = "https://carpentries.github.io/workbench/contributor/beta.html?id=" | append: repo_url %}
{% else %}
{% assign edit_url = repo_url %}
{% endif %}

{% if page.source == "Rmd" %}
<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>
{% else %}
<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>
<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>
{% 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 _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<title>
{% if page.title %}{{ page.title }}{% endif %}{% if page.title and site.title %} &ndash; {% endif %}{% if site.title %}{{ site.title }}{% endif %}
</title>
</title>

</head>
<body>
Expand Down
Loading

0 comments on commit f5a43c0

Please sign in to comment.