summaryrefslogtreecommitdiff
path: root/_includes/views/banner.html
blob: eb622d7ca506f376b8a6ad24a2847e9ba9f741fe (plain)
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
{%- include functions.html func='log' level='debug' msg='Get banner_html value' -%}
{% assign name = 'banner_html' %}
{%- include functions.html func='get_value' -%}
{% assign banner_html = return %}

{%- include functions.html func='log' level='debug' msg='Get heading value' -%}
{% assign name = 'heading' %}
{%- include functions.html func='get_value' -%}
{% assign heading = return %}

{%- include functions.html func='log' level='debug' msg='Get subheading value' -%}
{% assign name = 'subheading' %}
{%- include functions.html func='get_value' -%}
{% assign subheading = return %}

{%- include functions.html func='get_banner' -%}

{% if banner_image %}
  <style>
    html .page-banner {
      height: {{ banner_height }};
    }

    html .page-banner .page-banner-img > *:first-child {
      opacity: {{ banner_opacity }};
    }

    html[data-theme="dark"] .page-banner .page-banner-img > *:first-child {
      opacity: {{ banner_opacity | times: 0.6 }};
    }
  </style>
  <section class="page-banner">
    <div class="page-banner-img">
      <div style="background-image: url({{ banner_image }})"></div>
      <img class="img-placeholder" src="{{ banner_image }}"></div>
    </div>
    <div class="wrapper">
      <div class="page-banner-inner">

        {%- if banner_html -%}

        {%- assign banner_html = 'views/' | append: banner_html -%}
        {%- include {{ banner_html }} -%}

        {%- else -%}

          <div class="page-banner-default">
            <h1 class="page-banner-heading">
              {{ heading | default: page.title | escape }}
            </h1>
            <h2 class="page-banner-subheading">
              {{ subheading | default: page.subtitle | escape }}
            </h2>
          </div>

        {%- endif -%}
      </div>
    </div>
  </section>
{%- endif -%}