From 1dcf9fc21ecb1ae1ca234871b075f0be78d1d323 Mon Sep 17 00:00:00 2001 From: Greg Wilson <gvwilson@third-bit.com> Date: Thu, 23 Jun 2016 16:50:38 -0400 Subject: [PATCH] Switching to site.root and site.repo --- _includes/all_keypoints.html | 2 +- _includes/carpentries.html | 4 +-- _includes/episode_title.html | 10 +++---- _includes/javascript.html | 6 ++--- _includes/{footer.html => lesson_footer.html} | 13 ++-------- _includes/main_title.html | 2 +- _includes/navbar.html | 26 +++++++++---------- _includes/syllabus.html | 2 +- _layouts/base.html | 10 +++---- _layouts/workshop.html | 7 +++-- 10 files changed, 36 insertions(+), 46 deletions(-) rename _includes/{footer.html => lesson_footer.html} (50%) diff --git a/_includes/all_keypoints.html b/_includes/all_keypoints.html index 9e7cf2c..bedfd73 100644 --- a/_includes/all_keypoints.html +++ b/_includes/all_keypoints.html @@ -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="{{ site.root }}{{ episode.url }}">{{ episode.title }}</a> </td> <td class="col-md-9"> <ul> diff --git a/_includes/carpentries.html b/_includes/carpentries.html index e56c7d1..a195ebb 100644 --- a/_includes/carpentries.html +++ b/_includes/carpentries.html @@ -1,6 +1,6 @@ <div class="row"> <div class="col-md-2" align="center"> - <a href="{{ site.swc_site }}"><img src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /></a> + <a href="{{ site.swc_site }}"><img src="{{ site.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 }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /></a> + <a href="{{ site.dc_site }}"><img src="{{ site.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. diff --git a/_includes/episode_title.html b/_includes/episode_title.html index 5e2e4ec..767f38f 100644 --- a/_includes/episode_title.html +++ b/_includes/episode_title.html @@ -3,22 +3,22 @@ <div class="col-md-1"> <h3> {% if prev_episode %} - <a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a> + <a href="{{ site.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a> {% else %} - <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a> + <a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a> {% endif %} </h3> </div> <div class="col-md-10"> - <h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3> + <h3 class="maintitle"><a href="{{ site.root }}/">{{ site.title }}</a></h3> <h1 class="maintitle">{{ page.title }}</h1> </div> <div class="col-md-1"> <h3> {% if next_episode %} - <a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a> + <a href="{{ site.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a> {% else %} - <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a> + <a href="{{ site.root }}"><span class="glyphicon glyphicon-menu-up"></span></a> {% endif %} </h3> </div> diff --git a/_includes/javascript.html b/_includes/javascript.html index c2d678c..c8c66c0 100644 --- a/_includes/javascript.html +++ b/_includes/javascript.html @@ -1,3 +1,3 @@ -<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> +<script src="{{ site.root }}/assets/js/jquery.min.js"></script> +<script src="{{ site.root }}/assets/js/bootstrap.min.js"></script> +<script src="{{ site.root }}/assets/js/lesson.js"></script> diff --git a/_includes/footer.html b/_includes/lesson_footer.html similarity index 50% rename from _includes/footer.html rename to _includes/lesson_footer.html index d9d90ed..4c175a6 100644 --- a/_includes/footer.html +++ b/_includes/lesson_footer.html @@ -1,12 +1,3 @@ -{% comment %} - Generic footer. Links to repository, not to generated website, so - we do a bit of a dance to get the right URL. -{% endcomment %} -{% if site.is_production %} - {% capture repo_url %}{{ site.github.repository_url }}{% endcapture %} -{% else %} - {% capture repo_url %}https://github.com/{{ site.account }}/{{ site.project }}{% endcapture %} -{% endif %} <hr/> <footer> <div class="row"> @@ -19,9 +10,9 @@ </div> <div class="col-md-6" align="right"> <h4> - <a href="{{ repo_url }}">Source</a> + <a href="{{ site.repo }}/">Source</a> / - <a href="{{ repo_url }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a> + <a href="{{ site.repo }}/blob/gh-pages/CONTRIBUTING.md">Contributing</a> / <a href="mailto:{{ site.email }}">Contact</a> </h4> diff --git a/_includes/main_title.html b/_includes/main_title.html index 06019b9..4640300 100644 --- a/_includes/main_title.html +++ b/_includes/main_title.html @@ -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="{{ site.root }}/">{{ site.title }}</a>{% if page.title %}: {{ page.title }}{% endif %}</h1> diff --git a/_includes/navbar.html b/_includes/navbar.html index 00084bb..7da51db 100644 --- a/_includes/navbar.html +++ b/_includes/navbar.html @@ -9,47 +9,47 @@ </button> {% if page.carpentry == "swc" %} <a href="{{ site.swc_site }}" class="pull-left"> - <img class="navbar-logo" src="{{ site.github.url }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> + <img class="navbar-logo" src="{{ site.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 }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> + <img class="navbar-logo" src="{{ site.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 }}/assets/img/swc-icon-blue.svg" alt="Software Carpentry logo" /> + <img class="navbar-logo" src="{{ site.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 }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> + <img class="navbar-logo" src="{{ site.root }}/assets/img/dc-icon-black.svg" alt="Data Carpentry logo" /> </a> {% endif %} - <a class="navbar-brand" href="{{ site.github.url }}/">Home</a> + <a class="navbar-brand" href="{{ site.root }}/">Home</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> - <li><a href="{{ site.github.url }}/conduct/">Code of Conduct</a></li> + <li><a href="{{ site.root }}/conduct/">Code of Conduct</a></li> {% if site.kind == "lesson" %} - <li><a href="{{ site.github.url }}/setup/">Setup</a></li> + <li><a href="{{ site.root }}/setup/">Setup</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="{{ site.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="{{ site.root }}{{ episode.url }}">{{ episode.title }}</a></li> {% endfor %} </ul> </li> <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="{{ site.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="{{ site.root }}{{ extra.url }}">{{ extra.title }}</a></li> {% endfor %} </ul> </li> - <li><a href="{{ site.github.url }}/reference/">Reference</a></li> + <li><a href="{{ site.root }}/reference/">Reference</a></li> {% endif %} - <li><a href="{{ site.github.url }}/license/">License</a></li> + <li><a href="{{ site.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"> diff --git a/_includes/syllabus.html b/_includes/syllabus.html index 7783fdf..5f4b7c8 100644 --- a/_includes/syllabus.html +++ b/_includes/syllabus.html @@ -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="{{ site.root }}{{ episode.url }}">{{ episode.title }}</a> </td> <td class="col-md-7"> {% if episode.break %} diff --git a/_layouts/base.html b/_layouts/base.html index 12cef2e..d8bbc3b 100644 --- a/_layouts/base.html +++ b/_layouts/base.html @@ -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="https://{{ 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" /> + <meta name="search-domain" value="https://{{ site.root }}"> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/bootstrap.css" /> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/bootstrap-theme.css" /> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/lesson.css" /> {% if site.carpentry == "swc" %} <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" /> {% endif %} @@ -29,7 +29,7 @@ <div class="container"> {% include navbar.html %} {{ content }} - {% include footer.html %} + {% include lesson_footer.html %} </div> {% include javascript.html %} </body> diff --git a/_layouts/workshop.html b/_layouts/workshop.html index 870605a..c2cf2f1 100644 --- a/_layouts/workshop.html +++ b/_layouts/workshop.html @@ -25,10 +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"> - <meta name="search-domain" value="https://{{ 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" /> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/bootstrap.css" /> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/bootstrap-theme.css" /> + <link rel="stylesheet" type="text/css" href="{{ site.root }}/assets/css/lesson.css" /> {% if site.carpentry == "swc" %} <link rel="shortcut icon" type="image/x-icon" href="/favicon-swc.ico" /> {% endif %} -- GitLab