Commit fe255576 authored by Greg Wilson's avatar Greg Wilson
Browse files

Merge branch 'gh-pages' of github.com:swcarpentry/styles into gh-pages

parents 79fba64b cf155463
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{% unless episode.break %} {% unless episode.break %}
<tr> <tr>
<td class="col-md-3"> <td class="col-md-3">
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a> <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
</td> </td>
<td class="col-md-9"> <td class="col-md-9">
<ul> <ul>
......
<div class="row"> <div class="row">
<div class="col-md-2" align="center"> <div class="col-md-2" align="center">
<a href="{{ site.swc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a> <a href="{{ site.swc_site }}"><img src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
Since 1998, Since 1998,
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<br/> <br/>
<div class="row"> <div class="row">
<div class="col-md-2" align="center"> <div class="col-md-2" align="center">
<a href="{{ site.dc_site }}"><img src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a> <a href="{{ site.dc_site }}"><img src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches workshops on the fundamental data skills needed to conduct research. <a href="{{ site.dc_site }}">Data Carpentry</a> develops and teaches workshops on the fundamental data skills needed to conduct research.
......
{% comment %}
Find previous and next episodes (if any).
Including file must pass episode_navbar_title=true or ...=false to display episode title.
{% endcomment %}
{% for episode in site.episodes %}
{% if episode.url == page.url %}
{% unless forloop.first %}
{% assign prev_episode = prev %}
{% endunless %}
{% unless forloop.last %}
{% assign next_episode = site.episodes[forloop.index] %}
{% endunless %}
{% endif %}
{% assign prev = episode %}
{% endfor %}
{% comment %}
Display title and prev/next links.
{% endcomment %}
<div class="row">
<div class="col-md-1">
<h3>
{% if prev_episode %}
<a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
{% else %}
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %}
</h3>
</div>
<div class="col-md-10">
{% if include.episode_navbar_title %}
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
<h1 class="maintitle">{{ page.title }}</h1>
{% endif %}
</div>
<div class="col-md-1">
<h3>
{% if next_episode %}
<a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
{% else %}
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %}
</h3>
</div>
</div>
...@@ -20,26 +20,22 @@ ...@@ -20,26 +20,22 @@
<div class="col-md-1"> <div class="col-md-1">
<h3> <h3>
{% if prev_episode %} {% if prev_episode %}
<a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a> <a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
{% elsif site.github.url %}
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
{% else %} {% else %}
<a href="/"><span class="glyphicon glyphicon-menu-up"></span></a> <a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %} {% endif %}
</h3> </h3>
</div> </div>
<div class="col-md-10"> <div class="col-md-10">
<h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3> <h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
<h1 class="maintitle">{{ page.title }}</h1> <h1 class="maintitle">{{ page.title }}</h1>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">
<h3> <h3>
{% if next_episode %} {% if next_episode %}
<a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a> <a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
{% elsif site.github.url %}
<a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
{% else %} {% else %}
<a href="/"><span class="glyphicon glyphicon-menu-up"></span></a> <a href="{{ page.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %} {% endif %}
</h3> </h3>
</div> </div>
......
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/jquery.min.js"></script> <script src="{{ page.root }}/assets/js/jquery.min.js"></script>
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/bootstrap.min.js"></script> <script src="{{ page.root }}/assets/js/bootstrap.min.js"></script>
<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/lesson.js"></script> <script src="{{ page.root }}/assets/js/lesson.js"></script>
<hr/>
<footer> <footer>
<div class="row"> <div class="row">
<div class="col-md-6" align="left"> <div class="col-md-6" align="left">
......
<h1 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1> <h1 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
...@@ -11,41 +11,41 @@ ...@@ -11,41 +11,41 @@
{% comment %} Select what logo to display. {% endcomment %} {% comment %} Select what logo to display. {% endcomment %}
{% if page.carpentry == "swc" %} {% if page.carpentry == "swc" %}
<a href="{{ site.swc_site }}" class="pull-left"> <a href="{{ site.swc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> <img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
</a> </a>
{% elsif page.carpentry == "dc" %} {% elsif page.carpentry == "dc" %}
<a href="{{ site.dc_site }}" class="pull-left"> <a href="{{ site.dc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> <img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
</a> </a>
{% elsif site.carpentry == "swc" %} {% elsif site.carpentry == "swc" %}
<a href="{{ site.swc_site }}" class="pull-left"> <a href="{{ site.swc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> <img class="navbar-logo" src="{{ page.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
</a> </a>
{% elsif site.carpentry == "dc" %} {% elsif site.carpentry == "dc" %}
<a href="{{ site.dc_site }}" class="pull-left"> <a href="{{ site.dc_site }}" class="pull-left">
<img class="navbar-logo" src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> <img class="navbar-logo" src="{{ page.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
</a> </a>
{% endif %} {% endif %}
{% comment %} Always show link to home page. {% endcomment %} {% comment %} Always show link to home page. {% endcomment %}
<a class="navbar-brand" href="{{ site.github.url }}/">Home</a> <a class="navbar-brand" href="{{ page.root }}/">Home</a>
</div> </div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
{% comment %} Always show code of conduct. {% endcomment %} {% comment %} Always show code of conduct. {% endcomment %}
<li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li> <li><a href="{{ page.root }}/conduct/">Code of Conduct</a></li>
{% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %} {% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
{% if site.kind == "lesson" %} {% if site.kind == "lesson" %}
<li><a href="{{ site.github.url }}/setup/">Setup</a></li> <li><a href="{{ page.root }}/setup/">Setup</a></li>
<li><a href="{{ site.github.url }}/reference/">Reference</a></li> <li><a href="{{ page.root }}/reference/">Reference</a></li>
<li class="dropdown"> <li class="dropdown">
<a href="{{ site.github.url }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a> <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"> <ul class="dropdown-menu">
{% for episode in site.episodes %} {% for episode in site.episodes %}
<li><a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a></li> <li><a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>
...@@ -54,17 +54,17 @@ ...@@ -54,17 +54,17 @@
{% comment %} Show extras for lessons or if this is the main workshop-template repo (where they contain documentation). {% endcomment %} {% 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.github.repository_name == "workshop-template" %} {% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %}
<li class="dropdown"> <li class="dropdown">
<a href="{{ site.github.url }}/" 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">Extras <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
{% for extra in site.extras %} {% for extra in site.extras %}
<li><a href="{{ site.github.url }}{{ extra.url }}">{{ extra.title }}</a></li> <li><a href="{{ page.root }}{{ extra.url }}">{{ extra.title }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>
{% endif %} {% endif %}
{% comment %} Always show license. {% endcomment %} {% comment %} Always show license. {% endcomment %}
<li><a href="{{ site.github.url }}/license/">License</a></li> <li><a href="{{ page.root }}/license/">License</a></li>
</ul> </ul>
<form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;"> <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
<div class="form-group"> <div class="form-group">
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %} {% if multiday %}<td class="col-md-1">{% if episode.start %}Day {{ day }}{% endif %}</td>{% endif %}
<td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td> <td class="col-md-1">{% if hours < 10 %}0{% endif %}{{ hours }}:{% if minutes < 10 %}0{% endif %}{{ minutes }}</td>
<td class="col-md-3"> <td class="col-md-3">
<a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a> <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
</td> </td>
<td class="col-md-7"> <td class="col-md-7">
{% if episode.break %} {% if episode.break %}
......
<hr/>
<footer> <footer>
<div class="row"> <div class="row">
<div class="col-md-6" align="left"> <div class="col-md-6" align="left">
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="last-modified" content="{{ site.time }}"> <meta http-equiv="last-modified" content="{{ site.time }}">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="search-domain" value="{{ site.github.url | replace_first: 'http:', 'https:' }}"> <meta name="search-domain" value="{{ page.root }}">
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
{% if site.carpentry == "swc" %} {% if site.carpentry == "swc" %}
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
{% endif %} {% endif %}
......
--- ---
layout: base layout: base
--- ---
{% include episode_title.html %} {% include episode_navbar.html episode_navbar_title=true %}
{% include episode_break.html %} {% include episode_break.html %}
{{content}} {{content}}
{% include episode_navbar.html episode_navbar_title=false %}
--- ---
layout: base layout: base
--- ---
{% include episode_title.html %} {% include episode_navbar.html episode_navbar_title=true %}
{% include episode_overview.html %} {% include episode_overview.html %}
{{content}} {{content}}
{% include episode_keypoints.html %} {% include episode_keypoints.html %}
{% include episode_navbar.html episode_navbar_title=false %}
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="last-modified" content="{{ site.time }}"> <meta http-equiv="last-modified" content="{{ site.time }}">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
<link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" /> <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
{% if site.carpentry == "swc" %} {% if site.carpentry == "swc" %}
<link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" /> <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
{% endif %} {% endif %}
......
...@@ -225,6 +225,8 @@ collections: ...@@ -225,6 +225,8 @@ collections:
# Set the default layout for things in the episodes collection. # Set the default layout for things in the episodes collection.
defaults: defaults:
- values:
root: ..
- scope: - scope:
path: "" path: ""
type: episodes type: episodes
...@@ -243,6 +245,7 @@ highlighter: false ...@@ -243,6 +245,7 @@ highlighter: false
ROOT_INDEX_MD = '''\ ROOT_INDEX_MD = '''\
--- ---
layout: lesson layout: lesson
root: .
--- ---
FIXME: home page introduction FIXME: home page introduction
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment