aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/common/header.html
blob: 07ba1c5e54d85eae64e2633a24c918847063f498 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    {% assign project_name = site.settings.project.name %}
    {% unless project_name %}
      {% if site.github %}
        {% comment %}
          What the damn hell? site.github.is_project_page is set to true even
          for my root user site (the one with the .github.io suffix).
          TODO: remove the following workaround and replace with a simple check
          site.github.is_project_page above when this is fixed?
        {% endcomment %}
        {% capture assumed_user_name %}{{ site.github.owner_name }}.github.io{% endcapture %}
        {% if site.github.repository_name != assumed_user_name %}
          {% assign project_name = site.github.repository_name %}
        {% endif %}
      {% endif %}
    {% endunless %}
    {% assign author_name = site.settings.author.name %}
    {% unless author_name %}
      {% if site.github %}
        {% assign author_name = site.github.owner_name %}
      {% endif %}
    {% endunless %}
    {% assign author_name = author_name | default: 'John Doe' %}
    {% if project_name %}
      {% capture title %}{{ project_name }} - {{ author_name }}{% endcapture %}
    {% else %}
      {% capture title %}{{ author_name }}{% endcapture %}
    {% endif %}
    {% if page.url != '/' %}
      {% capture title %}{{ page.title }} - {{ title }}{% endcapture %}
    {% endif %}
    <title>{{ title }}</title>

    <link rel="stylesheet" href="{{ '/assets/bootstrap/css/bootstrap.min.css' | relative_url }}">
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    {% include mathjax.html %}

    <link rel="stylesheet" href="{{ '/assets/css/jekyll-theme.css' | relative_url }}">

    {% assign links = '' | split: '' %}
    {% if site.settings.links %}
      {% assign links = links | concat: site.settings.links %}
    {% endif %}
    {% if page.links %}
      {% assign links = links | concat: page.links %}
    {% endif %}

    {% for link in links %}
      {% assign abs_check = link.href | downcase | split: '//' %}
      {% if abs_check[0] == 'http:' or abs_check[0] == 'https:' or abs_check[0] == '' %}
        {% assign url = link.href %}
      {% else %}
        {% assign abs_check = link.href | slice: 0 %}
        {% if abs_check == '/' %}
          {% assign url = link.href %}
        {% else %}
          {% assign url = link.href | relative_url %}
        {% endif %}
      {% endif %}
      <link href="{{ url }}"{% for attr in link %}{% if attr[0] == 'href' %}{% continue %}{% endif %} {{ attr[0] }}="{{ attr[1] }}"{% endfor %}>
    {% endfor %}

    {% if site.settings.ga_tag %}
      {% include common/ga.html ga_tag=site.settings.ga_tag %}
    {% endif %}
  </head>
  <body>
    <div style="display: flex; flex-direction: column; min-height: 100vh;">
      {% include common/navbar.html %}
      <div class="container" style="flex: 1;">