Switching to GitHub-defined variables
authorGreg Wilson <gvwilson@third-bit.com>
Thu, 14 Jul 2016 14:28:36 +0000 (10:28 -0400)
committerGreg Wilson <gvwilson@third-bit.com>
Thu, 14 Jul 2016 14:28:36 +0000 (10:28 -0400)
12 files changed:
Makefile
_config_dev.yml [deleted file]
_includes/all_keypoints.html
_includes/carpentries.html
_includes/episode_title.html
_includes/javascript.html
_includes/lesson_footer.html
_includes/main_title.html
_includes/navbar.html
_includes/syllabus.html
_layouts/base.html
_layouts/workshop.html

index 3b51c3980040754c590ef14ff06e45115dd93ab2..0f395a310aeb0d795abed5ef50a77ee745337236 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -17,17 +17,16 @@ commands :
 
 ## serve            : run a local server.
 serve : lesson-rmd
-       ${JEKYLL} serve --config _config.yml,_config_dev.yml
+       ${JEKYLL} serve
 
 ## site             : build files but do not run a server.
 site : lesson-rmd
-       ${JEKYLL} build --config _config.yml,_config_dev.yml
+       ${JEKYLL} build
 
 # repo-check        : check repository settings.
 repo-check :
        @bin/repo_check.py -s .
 
-
 ## clean            : clean up junk files.
 clean :
        @rm -rf ${DST}
diff --git a/_config_dev.yml b/_config_dev.yml
deleted file mode 100644 (file)
index ad2653b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#------------------------------------------------------------
-# This config file is only needed for development. Instead of changing
-# the URL everytime you work locally on the project, run a server with
-# both configuration files:
-#
-#    jekyll serve --config _config.yml,_config_dev.yml
-#------------------------------------------------------------
-
-root: http://localhost:4000
index 898133a74077e32475ae9f24d6767a83304d2a4c..e2c901c2158a279a35d20298a27697d854442554 100644 (file)
@@ -7,7 +7,7 @@
   {% unless episode.break %}
     <tr>
       <td class="col-md-3">
-        <a href="{{ site.root }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-9">
         <ul>
index a195ebb3d05cb173adf1278c18df21917badf93d..e56c7d16b13b4f36d742a87dfff17306c954f460 100644 (file)
@@ -1,6 +1,6 @@
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.swc_site }}"><img src="{{ site.root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
+    <a href="{{ site.swc_site }}"><img src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a>
   </div>
   <div class="col-md-8">
     Since 1998,
@@ -14,7 +14,7 @@
 <br/>
 <div class="row">
   <div class="col-md-2" align="center">
-    <a href="{{ site.dc_site }}"><img src="{{ site.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
+    <a href="{{ site.dc_site }}"><img src="{{ site.github.url }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a>
   </div>
   <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.
index 767f38f226cf06cc8af6e07a78fec72d99cee9a5..5e2e4ec029e361b8faf600c4b6164896921d29c0 100644 (file)
@@ -3,22 +3,22 @@
   <div class="col-md-1">
     <h3>
       {% if prev_episode %}
-      <a href="{{ site.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
+      <a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
       {% else %}
-      <a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
       {% endif %}
     </h3>
   </div>
   <div class="col-md-10">
-    <h3 class="maintitle"><a href="{{ site.root }}/">{{ site.title }}</a></h3>
+    <h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3>
     <h1 class="maintitle">{{ page.title }}</h1>
   </div>
   <div class="col-md-1">
     <h3>
       {% if next_episode %}
-      <a href="{{ site.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
+      <a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
       {% else %}
-      <a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a>
+      <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
       {% endif %}
     </h3>
   </div>
index 95d49f0c1b8d8f449ff59c61f6cf6ac887a11f63..c2d678c4e52a6812fdac240be4cc7f7af41f1ebf 100644 (file)
@@ -1,12 +1,3 @@
-{% 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 %}
-<script src="{{ root }}/assets/js/jquery.min.js"></script>
-<script src="{{ root }}/assets/js/bootstrap.min.js"></script>
-<script src="{{ root }}/assets/js/lesson.js"></script>
+<script src="{{ site.github.url }}/assets/js/jquery.min.js"></script>
+<script src="{{ site.github.url }}/assets/js/bootstrap.min.js"></script>
+<script src="{{ site.github.url }}/assets/js/lesson.js"></script>
index 4c175a6203f06c81821a707f839109e5131acab8..58d08fae539edd130bab6ab781996ab21ce35338 100644 (file)
@@ -10,9 +10,9 @@
     </div>
     <div class="col-md-6" align="right">
       <h4>
-       <a href="{{ site.repo }}/">Source</a>
+       <a href="{{ site.github.repository_url }}/">Source</a>
        /
-       <a href="{{ site.repo }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
+       <a href="{{ site.github.repository_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a>
        /
        <a href="mailto:{{ site.email }}">Contact</a>
       </h4>
index 4640300e703cdd7946aba9e70bcde24b70c22c41..06019b93051f401df04425c66da5f156f30e5ff8 100644 (file)
@@ -1 +1 @@
-<h1 class="maintitle"><a href="{{ site.root }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
+<h1 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1>
index ff15ed1f0117f1d1cfb0f76279bba4f02252dde4..eea3ad8cd65ba5142dbd6088c13b875f8bb0e8bc 100644 (file)
@@ -1,12 +1,3 @@
-{% 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 %}
 <nav class="navbar navbar-default">
   <div class="container-fluid">
     <div class="navbar-header">
       {% comment %} Select what logo to display. {% endcomment %}
       {% if page.carpentry == "swc" %}
       <a href="{{ site.swc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
+        <img class="navbar-logo" src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
       </a>
       {% elsif page.carpentry == "dc" %}
       <a href="{{ site.dc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
+        <img class="navbar-logo" src="{{ site.github.url }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
       </a>
       {% elsif site.carpentry == "swc" %}
       <a href="{{ site.swc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ root }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
+        <img class="navbar-logo" src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" />
       </a>
       {% elsif site.carpentry == "dc" %}
       <a href="{{ site.dc_site }}" class="pull-left">
-        <img class="navbar-logo" src="{{ root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
+        <img class="navbar-logo" src="{{ site.github.url }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" />
       </a>
       {% endif %}
 
       {% comment %} Always show link to home page. {% endcomment %}
-      <a class="navbar-brand" href="{{ root }}/">Home</a>
+      <a class="navbar-brand" href="{{ site.github.url }}/">Home</a>
 
     </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="{{ root }}/conduct/">Code of Conduct</a></li>
+        <li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li>
 
        {% comment %} Show setup instructions, reference guide, and lesson episodes for lessons. {% endcomment %}
         {% if site.kind == "lesson" %}
-        <li><a href="{{ root }}/setup/">Setup</a></li>
-        <li><a href="{{ root }}/reference/">Reference</a></li>
+        <li><a href="{{ site.github.url }}/setup/">Setup</a></li>
+        <li><a href="{{ site.github.url }}/reference/">Reference</a></li>
         <li class="dropdown">
-          <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Episodes <span class="caret"></span></a>
+          <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>
           <ul class="dropdown-menu">
             {% for episode in site.episodes %}
-            <li><a href="{{ root }}{{ episode.url }}">{{ episode.title }}</a></li>
+            <li><a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a></li>
             {% 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" or site.repository_name == "workshop-template" %}
+       {% if site.kind == "lesson" or site.github.repository_name == "workshop-template" %}
         <li class="dropdown">
-          <a href="{{ root }}/" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Extras <span class="caret"></span></a>
+          <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>
           <ul class="dropdown-menu">
             {% for extra in site.extras %}
-            <li><a href="{{ root }}{{ extra.url }}">{{ extra.title }}</a></li>
+            <li><a href="{{ site.github.url }}{{ extra.url }}">{{ extra.title }}</a></li>
             {% endfor %}
           </ul>
         </li>
        {% endif %}
 
        {% comment %} Always show license. {% endcomment %}
-        <li><a href="{{ root }}/license/">License</a></li>
+        <li><a href="{{ site.github.url }}/license/">License</a></li>
       </ul>
       <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
         <div class="form-group">
index bb7d1ef190f69e4383031a8a583b933e5d14c656..67fa23f8fbef4d0be73a94654b6e36474a87465e 100644 (file)
@@ -34,7 +34,7 @@
       {% 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-3">
-        <a href="{{ site.root }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ site.github.url }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-7">
         {% if episode.break %}
index 383d8b374b2d11eb53cbdbe203f24436b31164be..2efa93a11ba15ded14bd44e6b7a3e4e7a6411e17 100644 (file)
@@ -1,14 +1,5 @@
 ---
 ---
-{% 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 %}
 <!doctype html>
 <html lang="en">
   <head>
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="last-modified" content="{{ site.time }}">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <meta name="search-domain" value="{{ root }}">
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap.css" />
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap-theme.css" />
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/lesson.css" />
+    <meta name="search-domain" value="{{ site.github.url }}">
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}
index d002ea28039c7ccd527dbce59e132e1579014ad5..b9367e0029e5137a616a3c7748736660fa61df2f 100644 (file)
@@ -1,14 +1,5 @@
 ---
 ---
-{% 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 %}
 <!doctype html>
 <html lang="en">
   <head>
@@ -34,9 +25,9 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta http-equiv="last-modified" content="{{ site.time }}">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap.css" />
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/bootstrap-theme.css" />
-    <link rel="stylesheet" type="text/css" href="{{ root }}/assets/css/lesson.css" />
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ site.github.url }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}