Switch to relative: use page.root in most templates
authorRémi Emonet <remi.emonet@reverse--com.heeere>
Mon, 5 Sep 2016 17:22:11 +0000 (19:22 +0200)
committerRémi Emonet <remi.emonet@reverse--com.heeere>
Mon, 5 Sep 2016 17:22:11 +0000 (19:22 +0200)
_includes/all_keypoints.html
_includes/carpentries.html
_includes/javascript.html
_includes/main_title.html
_includes/navbar.html
_includes/syllabus.html
_layouts/base.html
_layouts/workshop.html

index e2c901c2158a279a35d20298a27697d854442554..8563df340a8df11ffb4a23e27c15f31be15ed56b 100644 (file)
@@ -7,7 +7,7 @@
   {% unless episode.break %}
     <tr>
       <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 class="col-md-9">
         <ul>
index a233117a0a8e308c32c8829dc43c0e6614f4684a..69e2e1cc59b859a60245e02ffb3e9f3eeafd3f4e 100644 (file)
@@ -1,6 +1,6 @@
 <div class="row">
   <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 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.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 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 ccf0a887a0ebd831b47c86be69e25277ebd33366..a9a9297db3e67febcb721d6a90621ba9496eee2f 100644 (file)
@@ -1,3 +1,3 @@
-<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/js/jquery.min.js"></script>
-<script src="{{ site.github.url | replace_first: 'http:', 'https:' }}/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/jquery.min.js"></script>
+<script src="{{ page.root }}/assets/js/bootstrap.min.js"></script>
+<script src="{{ page.root }}/assets/js/lesson.js"></script>
index 06019b93051f401df04425c66da5f156f30e5ff8..60b8b06937c72e5125f392ba34c7327db92de906 100644 (file)
@@ -1 +1 @@
-<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>
index b5dafb46562afe720ff2b397b3c570fe37003622..126fe3d0a10a7959d5d3b97780f9c783e65a6cfc 100644 (file)
       {% comment %} Select what logo to display. {% endcomment %}
       {% if page.carpentry == "swc" %}
       <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>
       {% elsif page.carpentry == "dc" %}
       <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>
       {% elsif site.carpentry == "swc" %}
       <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>
       {% elsif site.carpentry == "dc" %}
       <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>
       {% endif %}
 
       {% 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 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="{{ 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 %}
         {% if site.kind == "lesson" %}
-        <li><a href="{{ site.github.url }}/setup/">Setup</a></li>
-        <li><a href="{{ site.github.url }}/reference/">Reference</a></li>
+        <li><a href="{{ page.root }}/setup/">Setup</a></li>
+        <li><a href="{{ page.root }}/reference/">Reference</a></li>
         <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">
             {% 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 %}
           </ul>
         </li>
        {% 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" %}
         <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">
             {% 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 %}
           </ul>
         </li>
        {% endif %}
 
        {% 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>
       <form class="navbar-form navbar-right" role="search" id="search" onsubmit="google_search(); return false;">
         <div class="form-group">
index 67fa23f8fbef4d0be73a94654b6e36474a87465e..c31672cc081f4b5d68afa1699b49bf023039e7ea 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.github.url }}{{ episode.url }}">{{ episode.title }}</a>
+        <a href="{{ page.root }}{{ episode.url }}">{{ episode.title }}</a>
       </td>
       <td class="col-md-7">
         {% if episode.break %}
index 20ce747ff4700626971da60e44f9631029610fa8..6390a7e80986ab325633db655028354942734b68 100644 (file)
@@ -7,10 +7,10 @@
     <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="{{ site.github.url | replace_first: 'http:', 'https:' }}">
-    <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="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/bootstrap-theme.css" />
-    <link rel="stylesheet" type="text/css" href="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
+    <meta name="search-domain" value="{{ page.root }}">
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}
index d52ee6246c86b694bf9693e5515681ef72e3e3df..f29e3ce117ccce3dd5cf6837e203169c692166b0 100644 (file)
@@ -25,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="{{ site.github.url | replace_first: 'http:', 'https:' }}/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="{{ site.github.url | replace_first: 'http:', 'https:' }}/assets/css/lesson.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
+    <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
     {% if site.carpentry == "swc" %}
     <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" />
     {% endif %}