diff --git a/_includes/javascript.html b/_includes/javascript.html index c8c66c0..95d49f0 100644 --- a/_includes/javascript.html +++ b/_includes/javascript.html @@ -1,3 +1,12 @@ - - - +{% comment %} + If previewing locally, site.root is set in _config_dev.yml. + If site.root is not set, assume we're viewing on the web. +{% endcomment %} +{% if site.root %} + {% assign root = site.root %} +{% else %} + {% assign root = site.github.url %} +{% endif %} + + + diff --git a/_includes/navbar.html b/_includes/navbar.html index 7da51db..ff15ed1 100644 --- a/_includes/navbar.html +++ b/_includes/navbar.html @@ -1,3 +1,12 @@ +{% comment %} + If previewing locally, site.root is set in _config_dev.yml. + If site.root is not set, assume we're viewing on the web. +{% endcomment %} +{% if site.root %} + {% assign root = site.root %} +{% else %} + {% assign root = site.github.url %} +{% endif %} @@ -7,49 +16,64 @@ + + {% comment %} Select what logo to display. {% endcomment %} {% if page.carpentry == "swc" %} - + {% elsif page.carpentry == "dc" %} - + {% elsif site.carpentry == "swc" %} - + {% elsif site.carpentry == "dc" %} - + {% endif %} - Home + + {% comment %} Always show link to home page. {% endcomment %} + Home + - Code of Conduct + + {% comment %} Always show code of conduct. {% endcomment %} + Code of Conduct + + {% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %} {% if site.kind == "lesson" %} - Setup + Setup + Reference - Episodes + Episodes {% for episode in site.episodes %} - {{ episode.title }} + {{ episode.title }} {% endfor %} + {% endif %} + + {% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %} + {% if site.kind == "lesson" or site.repository_name == "workshop-template" %} - Extras + Extras {% for extra in site.extras %} - {{ extra.title }} + {{ extra.title }} {% endfor %} - Reference - {% endif %} - License + {% endif %} + + {% comment %} Always show license. {% endcomment %} + License diff --git a/_layouts/base.html b/_layouts/base.html index d8bbc3b..383d8b3 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -1,5 +1,14 @@ --- --- +{% comment %} + If previewing locally, site.root is set in _config_dev.yml. + If site.root is not set, assume we're viewing on the web. +{% endcomment %} +{% if site.root %} + {% assign root = site.root %} +{% else %} + {% assign root = site.github.url %} +{% endif %} @@ -7,10 +16,10 @@ - - - - + + + + {% if site.carpentry == "swc" %} {% endif %} @@ -29,7 +38,11 @@ {% include navbar.html %} {{ content }} + {% if site.kind == "workshop" %} + {% include workshop_footer.html %} + {% else %} {% include lesson_footer.html %} + {% endif %} {% include javascript.html %} diff --git a/_layouts/workshop.html b/_layouts/workshop.html index c2cf2f1..d002ea2 100644 --- a/_layouts/workshop.html +++ b/_layouts/workshop.html @@ -1,5 +1,14 @@ --- --- +{% comment %} + If previewing locally, site.root is set in _config_dev.yml. + If site.root is not set, assume we're viewing on the web. +{% endcomment %} +{% if site.root %} + {% assign root = site.root %} +{% else %} + {% assign root = site.github.url %} +{% endif %} @@ -25,9 +34,9 @@ - - - + + + {% if site.carpentry == "swc" %} {% endif %}