48 lines
1.3 KiB
HTML

{%- comment -%}
Include vars:
title
subtitle
photo
photo-alt
auto-header
content
{%- endcomment -%}
{%- assign _title = include.title | default: 'Untitled' -%}
{%- assign _slug = include.title | strip_html | slugify | default: 'untitled' -%}
{%- if include.photo and include.photo-alt -%}
{%- capture _photo -%}
<img src="{{- include.photo | relative_url -}}" alt="{{- include.photo-alt -}}" class="back">
{%- endcapture -%}
{%- assign _class = 'shade-one cover dark' -%}
{%- else -%}
{%- assign _photo = '' -%}
{%- capture _class -%}shade-{%- cycle 'two', 'three', 'four', 'three' -%}{%- endcapture -%}
{%- endif -%}
{%- if include.auto-header == 'none' -%}
{%- assign _heading = "" -%}
{%- else -%}
{%- capture _heading -%}
<header>
<h2 style="background-color: #0000000A; font-weight: bold">
{%- if include.auto-header == null or include.auto-header == 'use-title' -%}
{{- _title -}}
{%- else -%}
{{- include.auto-header -}}
{%- endif -%}
</h2>
{%- if include.subtitle -%}<p>{{- include.subtitle -}}</p>{%- endif -%}
</header>
{%- endcapture -%}
{%- endif -%}
<section id="{{- _slug -}}" class="{{- _class -}}">
<div class="container">
{{- _photo -}}
{{- _heading -}}
{{- include.content -}}
</div>
</section>