use site.github.url only in production
[rnaseq-cwl-training.git] / _layouts / base.html
1 ---
2 ---
3
4 {% comment %}
5 When rendering websites locally, `site.github.url` doesn't get resolved
6 properly unless GitHub PAT are set up and available in the environment.
7 This leads to warnings and errors when trying to serve the site locally.
8 To work around this, we use the `jekyll.environment` variable which is set to
9 `development` when rendering the site locally, and set to `production` on
10 GitHub where `site.github.url` will be defined.
11 {% endcomment %}
12
13 {% if jekyll.environment == "development" %}
14 {% assign search_domain_url = "" %}
15 {% elsif jekyll.environment == "production" %}
16 {% assign search_domain_url = site.github.url  %}
17 {% endif %}
18
19 <!doctype html>
20 <html lang="en">
21   <head>
22     <meta charset="utf-8">
23     <meta http-equiv="X-UA-Compatible" content="IE=edge">
24     <meta http-equiv="last-modified" content="{{ site.time }}">
25     <meta name="viewport" content="width=device-width, initial-scale=1">
26     <!-- meta "search-domain" used for google site search function google_search() -->
27     <meta name="search-domain" value="{{ search_domain_url }}">
28     <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap.css" />
29     <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/bootstrap-theme.css" />
30     <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/lesson.css" />
31     <link rel="stylesheet" type="text/css" href="{{ page.root }}/assets/css/syntax.css" />
32
33     {% include favicons.html %}
34
35     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
36     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
37     <!--[if lt IE 9]>
38         <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
39         <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
40         <![endif]-->
41     <title>{{ site.title }}{% if page.title %}: {{ page.title }}{% endif %}</title>
42   </head>
43   <body>
44     <div class="container">
45       {% include navbar.html %}
46 {{ content }}
47       {% if site.kind == "workshop" %}
48       {% include workshop_footer.html %}
49       {% else %}
50       {% include lesson_footer.html %}
51       {% endif %}
52     </div>
53     {% include javascript.html %}
54   </body>
55 </html>