_includes/section.html in jekyll-theme-prologue-0.2.5 vs _includes/section.html in jekyll-theme-prologue-0.3.0
- old
+ new
@@ -1,7 +1,47 @@
-<section id="{{ include.id | normalize_whitespace }}" class="{{ include.class | normalize_whitespace }}">
+{%- 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>
+ {%- 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">
- {{ include.photo }}
- {{ include.heading }}
- {{ include.content }}
+ {{- _photo -}}
+ {{- _heading -}}
+ {{- include.content -}}
</div>
</section>