aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/_includes/jekyll-theme/footer.html
blob: c0745b56fc778e89df4f9735cc0db72c40896a82 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
      </div>
      <footer class="navbar-default">
        <div class="container">
          <div class="row">
            <div class="col-xs-12 text-center">

{% if site.settings.project.license_file %}
  {% capture license_file %}{{ '/' | relative_url }}{{ site.settings.project.license_file }}{% endcapture %}
{% else %}
  {% for file in site.static_files %}
    {% assign path = file.path | downcase %}
    {% if path == '/license' or path == '/license.txt' %}
      {% assign license_file = file.path | relative_url %}
    {% endif %}
  {% endfor %}
{% endif %}
{% if site.settings.project.license %}
  {% assign license = site.settings.project.license %}
  {% unless license_file %}
    {% capture license_file %}https://spdx.org/licenses/{{ license }}.html{% endcapture %}
    {% capture license %}{{ license }} License{% endcapture %}
  {% endunless %}
{% elsif site.github.license %}
  {% assign license = site.github.license.name %}
  {% unless license_file %}
    {% capture license_file %}https://spdx.org/licenses/{{ site.github.license.spdx_id }}.html{% endcapture %}
  {% endunless %}
{% endif %}
{% if license %}
  {% capture license_text %}<a href="{{ license_file }}">{{ license }}</a>{% endcapture %}
{% elsif license_file %}
  {% capture license_text %}License: <a href="{{ license_file }}">view</a>{% endcapture %}
{% endif %}

{% capture timestamp_text %}Build: {{ site.time | date: '%F' }}{% endcapture %}
{% capture theme_text %}<a href="https://egort.name/jekyll-theme/">jekyll-theme</a>{% endcapture %}

{% assign footer_items = '' | split: '' %}
{% if license_text %}
  {% assign footer_items = footer_items | push: license_text %}
{% endif %}
{% assign footer_items = footer_items | push: timestamp_text %}
{% assign footer_items = footer_items | push: theme_text %}

{% capture sep %}<span class="footer-item-sep">|</span>{% endcapture %}
<div class="small text-muted footer-items">
  {%- comment -%}
    Make sure to collapse the Liquid whitespace here.
    If you replace the <div>s with <span>s and don't collapse whitespace,
    extra spaces will be inserted between elements.
  {%- endcomment -%}
  {%- for item in (1..footer_items.size) -%}
    {%- assign idx = item | minus: 1 -%}
    {%- if item == 1 -%}
      <div class="footer-item">{{ footer_items[idx] }}</div>
    {%- else -%}
      <div class="footer-item">{{ sep }}{{ footer_items[idx] }}</div>
    {%- endif -%}
  {%- endfor -%}
</div>

            </div>
          </div>
        </div>
      </footer>
    </div>
    <script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script src="{{ '/assets/bootstrap/js/bootstrap.min.js' | relative_url }}"></script>

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

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