Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp navigation bar #220

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ collections:
extras:
output: true
permalink: /:path/index.html
extras4learners:
output: true
permalink: /:path/index.html
extras4instructors:
output: true
permalink: /:path/index.html

# Set the default layout for things in the episodes collection.
defaults:
Expand All @@ -78,6 +84,18 @@ defaults:
values:
root: ..
layout: page
- scope:
path: ""
type: extras4learners
values:
root: ..
layout: page
- scope:
path: ""
type: extras4instructors
values:
root: ..
layout: page

# Files and directories that are not to be copied.
exclude:
Expand Down
1 change: 1 addition & 0 deletions _extras/about.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: About
order: 100
---

{% include carpentries.html %}
2 changes: 2 additions & 0 deletions aio.md → _extras4instructors/aio.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
title: All in one page (Beta)
order: 2
---
<script>
window.onload = function() {
Expand Down
1 change: 1 addition & 0 deletions _extras/figures.md → _extras4instructors/figures.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Figures
order: 3
---
<script>
window.onload = function() {
Expand Down
1 change: 1 addition & 0 deletions _extras/guide.md → _extras4instructors/notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: "Instructor Notes"
order: 1
---

The instructor notes should provide additional discussion useful to instructors,
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions _extras/discuss.md → _extras4learners/discuss.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Discussion
order: 2
---

Readers may be interested in:
Expand Down
1 change: 1 addition & 0 deletions reference.md → _extras4learners/reference.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: reference
order: 1
---

## Glossary
Expand Down
1 change: 1 addition & 0 deletions setup.md → _extras4learners/setup.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Setup
order: -1
---

Our lesson template is kept in the [`carpentries/styles` repository][styles]. The `styles` repository is carefully curated so that
Expand Down
44 changes: 30 additions & 14 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,42 +36,58 @@
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">

{% comment %} Always show code of conduct. {% endcomment %}
<li><a href="{{ page.root }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>

{% if site.kind == "lesson" %}
{% comment %} Show setup instructions. {% endcomment %}
<li><a href="{{ page.root }}{% link setup.md %}">Setup</a></li>

{% comment %} Show lesson episodes for lessons. {% endcomment %}
<li class="dropdown">
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
<ul class="dropdown-menu">
{% comment %} Front matter {% endcomment %}
{% assign extras = site.extras4learners | sort: 'order' | reverse %}
{% for extra in extras %}
{% if extra.order < 0 %}
<li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
{% endif %}
{% endfor %}
<li role="separator" class="divider"></li>
{% comment %} Body matter {% endcomment %}
{% for episode in site.episodes %}
<li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
<li><a href="{{ page.root }}{{ episode.url }}">{{ forloop.index }}. {{ episode.title }}</a></li>
{% endfor %}
<li role="separator" class="divider"></li>
<li><a href="{{ page.root }}{% link aio.md %}">All in one page (Beta)</a></li>
{% comment %} Back matter {% endcomment %}
{% assign extras = site.extras4learners | sort: 'order' %}
{% for extra in extras %}
{% if extra.order > 0 %}
<li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endif %}

{% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %}
{% if site.kind == "lesson" %}
<li class="dropdown">
<a href="{{ page.root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
<a href="{{ page.root }}/" class="dropdown-toggle"
data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">For Instructors <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{{ page.root }}{% link reference.md %}">Reference</a></li>
{% for extra in site.extras %}
{% assign extras = site.extras4instructors | sort: 'order' %}
{% for extra in extras %}
<li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
{% endfor %}
</ul>
</li>
{% endif %}

{% comment %} Always show information about The Carpentries. {% endcomment %}
<li><a href="{{ page.root }}{% link _extras/about.md %}">About The Carpentries</a></li>

{% comment %} Always show license. {% endcomment %}
<li><a href="{{ page.root }}{% link LICENSE.md %}">License</a></li>

{% comment %} Always show code of conduct. {% endcomment %}
<li><a href="{{ page.root }}{% link CODE_OF_CONDUCT.md %}">Code of Conduct</a></li>

{% comment %} Always show link to edit page on GitHub. {% endcomment %}
{% 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>
Expand Down
2 changes: 1 addition & 1 deletion _includes/syllabus.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h2 id="schedule">Schedule</h2>
<tr>
{% if multiday %}<td class="col-md-1"></td>{% endif %}
<td class="{% if multiday %}col-md-1{% else %}col-md-2{% endif %}"></td>
<td class="col-md-3"><a href="{{ page.root }}{% link setup.md %}">Setup</a></td>
<td class="col-md-3"><a href="{{ page.root }}{% link _extras4learners/setup.md %}">Setup</a></td>
<td class="col-md-7">Download files required for the lesson</td>
</tr>
{% for episode in site.episodes %}
Expand Down
2 changes: 1 addition & 1 deletion index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This lesson shows how to use the
For guidelines on how to help improve our lessons and this template,
please see [the contribution guidelines][contributing];
for guidelines on how to set up your machine to preview changes locally,
please see [the setup instructions]({{ page.root }}{% link setup.md %}).
please see [the setup instructions]({{ page.root }}{% link _extras4learners/setup.md %}).

> ## Prerequisites
>
Expand Down