|
1 | | -{% if page.header == NULL and page.header.image_fullwidth == NULL and page.header.pattern == NULL and page.header.background-color == NULL and page.header.title == NULL %} |
| 1 | +{% comment %} Masthead with safer Liquid checks and fallback to text brand if no logo set {% endcomment %} |
2 | 2 |
|
| 3 | +{%- assign header = page.header -%} |
| 4 | + |
| 5 | +{% if header == nil or header == empty %} |
3 | 6 | <div id="masthead-no-image-header"> |
4 | | - <div class="row"> |
5 | | - <div class="small-12 columns"> |
6 | | - <a id="logo" href="{{ '/' | absolute_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
7 | | - <img src="{{ site.url }}{{ site.baseurl }}/assets/img/{{ site.logo }}" alt="{{ site.title }} – {{ site.slogan }}"> |
8 | | - </a> |
9 | | - </div><!-- /.small-12.columns --> |
10 | | - </div><!-- /.row --> |
| 7 | + <div class="row"> |
| 8 | + <div class="small-12 columns"> |
| 9 | + {% if site.logo and site.logo != "" %} |
| 10 | + <a id="logo" href="{{ '/' | absolute_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
| 11 | + <img src="{{ '/assets/img/' | absolute_url }}{{ site.logo }}" alt="{{ site.title }} – {{ site.slogan }}"> |
| 12 | + </a> |
| 13 | + {% else %} |
| 14 | + <a id="logo-text" href="{{ '/' | relative_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
| 15 | + <span class="site-title-text">{{ site.slogan | default: "Experiments-As-A-Service-Infrastructure" }}</span> |
| 16 | + </a> |
| 17 | + <style> |
| 18 | + .site-title-text { font-weight:700; color:#0f172a; font-size:1rem; text-decoration:none; } |
| 19 | + </style> |
| 20 | + {% endif %} |
| 21 | + </div><!-- /.small-12.columns --> |
| 22 | + </div><!-- /.row --> |
11 | 23 | </div><!-- /#masthead --> |
12 | 24 |
|
13 | 25 | {% if page.breadcrumb == true %} |
14 | 26 | {% include _breadcrumb.html %} |
15 | 27 | {% endif %} |
16 | 28 |
|
| 29 | +{% elsif header.title %} |
17 | 30 |
|
18 | | - |
19 | | - |
20 | | - |
21 | | -{% elsif page.header.title %} |
22 | | - |
23 | | -<div id="masthead-with-text" style="{% if page.header.background-color %}background: {{ page.header.background-color }};{% endif %} {% if page.header.image_fullwidth %}{% elsif page.header.pattern %}background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url('{{ site.urlimg }}/{{ page.header.pattern }}'){% endif %}"> |
24 | | - <div class="row"> |
25 | | - <div class="small-12 columns"> |
26 | | - <div class="masthead-title">{{ page.header.title }}</div> |
27 | | - </div><!-- /.small-12.columns --> |
28 | | - </div><!-- /.row --> |
| 31 | +<div id="masthead-with-text" style="{% if header['background-color'] %}background: {{ header['background-color'] }};{% endif %} {% if header.image_fullwidth %}{% elsif header.pattern %}background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url('{{ site.urlimg }}/{{ header.pattern }}'){% endif %}"> |
| 32 | + <div class="row"> |
| 33 | + <div class="small-12 columns"> |
| 34 | + <div class="masthead-title">{{ header.title }}</div> |
| 35 | + </div><!-- /.small-12.columns --> |
| 36 | + </div><!-- /.row --> |
29 | 37 | </div><!-- /#masthead --> |
30 | 38 |
|
31 | 39 | {% if page.breadcrumb == true %} |
32 | 40 | {% include _breadcrumb.html %} |
33 | 41 | {% endif %} |
34 | 42 |
|
35 | | -{% if page.header.caption_url && page.header.caption %} |
| 43 | +{% if header.caption_url and header.caption %} |
36 | 44 | <div class="masthead-caption"> |
37 | | - <a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a> |
| 45 | + <a href="{{ header.caption_url }}">{{ header.caption }}</a> |
38 | 46 | </div> |
39 | | -{% elsif page.header.caption %} |
| 47 | +{% elsif header.caption %} |
40 | 48 | <div class="masthead-caption"> |
41 | | - {{ page.header.caption }} |
| 49 | + {{ header.caption }} |
42 | 50 | </div> |
43 | 51 | {% endif %} |
44 | 52 |
|
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | | -{% elsif page.header.image_fullwidth %} |
| 53 | +{% elsif header.image_fullwidth %} |
50 | 54 |
|
51 | 55 | <div id="masthead"> |
52 | | - <div class="row"> |
53 | | - <div class="small-12 columns"> |
54 | | - <a id="logo" href="{{ '/' | absolute_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
55 | | - <img src="{{ site.url }}{{ site.baseurl }}/assets/img/{{ site.logo }}" alt="{{ site.title }} – {{ site.slogan }}"> |
56 | | - </a> |
57 | | - </div><!-- /.small-12.columns --> |
58 | | - </div><!-- /.row --> |
| 56 | + <div class="row"> |
| 57 | + <div class="small-12 columns"> |
| 58 | + {% if site.logo and site.logo != "" %} |
| 59 | + <a id="logo" href="{{ '/' | absolute_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
| 60 | + <img src="{{ '/assets/img/' | absolute_url }}{{ site.logo }}" alt="{{ site.title }} – {{ site.slogan }}"> |
| 61 | + </a> |
| 62 | + {% else %} |
| 63 | + <a id="logo-text" href="{{ '/' | relative_url }}" title="{{ site.title }} – {{ site.slogan }}"> |
| 64 | + <span class="site-title-text">{{ site.slogan | default: "Experiments-As-A-Service-Infrastructure" }}</span> |
| 65 | + </a> |
| 66 | + {% endif %} |
| 67 | + </div><!-- /.small-12.columns --> |
| 68 | + </div><!-- /.row --> |
59 | 69 | </div><!-- /#masthead --> |
60 | 70 |
|
61 | 71 | {% if page.breadcrumb == true %} |
62 | 72 | {% include _breadcrumb.html %} |
63 | 73 | {% endif %} |
64 | 74 |
|
65 | | -{% if page.header.caption_url && page.header.caption %} |
| 75 | +{% if header.caption_url and header.caption %} |
66 | 76 | <div class="masthead-caption"> |
67 | | - <a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a> |
| 77 | + <a href="{{ header.caption_url }}">{{ header.caption }}</a> |
68 | 78 | </div> |
69 | | -{% elsif page.header.caption %} |
| 79 | +{% elsif header.caption %} |
70 | 80 | <div class="masthead-caption"> |
71 | | - {{ page.header.caption }} |
| 81 | + {{ header.caption }} |
72 | 82 | </div> |
73 | 83 | {% endif %} |
74 | 84 |
|
| 85 | +{% elsif header.pattern %} |
75 | 86 |
|
76 | | - |
77 | | - |
78 | | - |
79 | | -{% elsif page.header.pattern %} |
80 | | - |
81 | | -<div id="masthead-with-pattern" style="background: url('{{ site.urlimg }}/{{ page.header.pattern }}')"> |
82 | | - <div class="row"> |
83 | | - <figure class="small-12 columns"> |
84 | | - <img src="{{ site.urlimg }}/{{ page.header.image }}" alt="{{ site.title }}"> |
85 | | - </figure><!-- /.small-12.columns --> |
86 | | - </div><!-- /.row --> |
| 87 | +<div id="masthead-with-pattern" style="background: url('{{ site.urlimg }}/{{ header.pattern }}')"> |
| 88 | + <div class="row"> |
| 89 | + <figure class="small-12 columns"> |
| 90 | + {% if header.image %} |
| 91 | + <img src="{{ site.urlimg }}/{{ header.image }}" alt="{{ site.title }}"> |
| 92 | + {% endif %} |
| 93 | + </figure><!-- /.small-12.columns --> |
| 94 | + </div><!-- /.row --> |
87 | 95 | </div><!-- /#masthead --> |
88 | 96 |
|
89 | 97 | {% if page.breadcrumb == true %} |
90 | 98 | {% include _breadcrumb.html %} |
91 | 99 | {% endif %} |
92 | 100 |
|
93 | | -{% if page.header.caption_url && page.header.caption %} |
| 101 | +{% if header.caption_url and header.caption %} |
94 | 102 | <div class="masthead-caption"> |
95 | | - <a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a> |
| 103 | + <a href="{{ header.caption_url }}">{{ header.caption }}</a> |
96 | 104 | </div> |
97 | | -{% elsif page.header.caption %} |
| 105 | +{% elsif header.caption %} |
98 | 106 | <div class="masthead-caption"> |
99 | | - {{ page.header.caption }} |
| 107 | + {{ header.caption }} |
100 | 108 | </div> |
101 | 109 | {% endif %} |
102 | 110 |
|
| 111 | +{% elsif header['background-color'] %} |
103 | 112 |
|
104 | | - |
105 | | - |
106 | | - |
107 | | -{% elsif page.header.background-color %} |
108 | | - |
109 | | -<div id="masthead-with-background-color" style="background: {{ page.header.background-color }};"> |
110 | | - <div class="row"> |
111 | | - <figure class="small-12 columns"> |
112 | | - <img src="{{ site.urlimg }}/{{ page.header.image }}" alt="{{ site.title }}"> |
113 | | - </figure><!-- /.small-12.columns --> |
114 | | - </div><!-- /.row --> |
| 113 | +<div id="masthead-with-background-color" style="background: {{ header['background-color'] }};"> |
| 114 | + <div class="row"> |
| 115 | + <figure class="small-12 columns"> |
| 116 | + {% if header.image %} |
| 117 | + <img src="{{ site.urlimg }}/{{ header.image }}" alt="{{ site.title }}"> |
| 118 | + {% endif %} |
| 119 | + </figure><!-- /.small-12.columns --> |
| 120 | + </div><!-- /.row --> |
115 | 121 | </div><!-- /#masthead --> |
116 | 122 |
|
117 | 123 | {% if page.breadcrumb == true %} |
118 | 124 | {% include _breadcrumb.html %} |
119 | 125 | {% endif %} |
120 | 126 |
|
121 | | -{% if page.header.caption_url && page.header.caption %} |
| 127 | +{% if header.caption_url and header.caption %} |
122 | 128 | <div class="masthead-caption"> |
123 | | - <a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a> |
| 129 | + <a href="{{ header.caption_url }}">{{ header.caption }}</a> |
124 | 130 | </div> |
125 | | -{% elsif page.header.caption %} |
| 131 | +{% elsif header.caption %} |
126 | 132 | <div class="masthead-caption"> |
127 | | - {{ page.header.caption }} |
| 133 | + {{ header.caption }} |
128 | 134 | </div> |
129 | 135 | {% endif %} |
130 | 136 |
|
131 | | - |
132 | | - |
133 | | - |
134 | | - |
135 | | -{% elsif page.header == false %} |
| 137 | +{% elsif header == false %} |
136 | 138 |
|
137 | 139 | {% if page.breadcrumb == true %} |
138 | 140 | {% include _breadcrumb.html %} |
|
0 commit comments