Skip to content
Snippets Groups Projects
Commit ea14da0c authored by Eloi Perdereau's avatar Eloi Perdereau
Browse files

update layouts to match cms-driven front-matter

parent 1afe2897
No related branches found
No related tags found
1 merge request!5Big fat update, mostly cms configuration
......@@ -278,9 +278,6 @@ defaults:
values:
layout: single
author_profile: true
share: true
toc_sticky: true
header:
show_overlay_excerpt: false
sidebar:
nav: true
{% if page.header.cta_url contains "://" %}
{% capture cta_path %}{{ page.header.cta_url }}{% endcapture %}
{% if page.header.type == 'default' %}
{% capture header_type %}overlay{% endcapture %}
{% capture overlay_title %}true{% endcapture %}
{% capture overlay_text %}{{ page.header.description }}{% endcapture %}
{% capture overlay_actions %}false{% endcapture %}
{% capture img_path %}{{ author.banner }}{% endcapture %}
{% else %}
{% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% endif %}
{% if page.header.fixed_image contains "://" %}
{% capture fixed_img_path %}{{ page.header.fixed_image}}{% endcapture %}
{% else %}
{% capture fixed_img_path %}{{ page.header.fixed_image | relative_url }}{% endcapture %}
{% capture header_type %}{{ page.header.type }}{% endcapture %}
{% if page.header.fixed_image contains "://" %}
{% capture fixed_img_path %}{{ page.header.fixed_image}}{% endcapture %}
{% else %}
{% capture fixed_img_path %}{{ page.header.fixed_image | relative_url }}{% endcapture %}
{% endif %}
{% if page.header.overlay_image contains "://" %}
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %}
{% elsif page.header.overlay_image %}
{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %}
{% endif %}
{% if header_type == 'overlay' %}
{% capture img_path %}{{ overlay_img_path }}{% endcapture %}
{% elsif header_type == 'image' %}
{% capture img_path %}{{ fixed_img_path }}{% endcapture %}
{% endif %}
{% capture overlay_title %}{{ page.header.overlay_title }}{% endcapture %}
{% if page.header.show_text == 'description' %}
{% capture overlay_text %}{{ page.description }}{% endcapture %}
{% elsif page.header.show_text == 'custom' %}
{% capture overlay_text %}{{ page.header.custom_text }}{% endcapture %}
{% endif %}
{% if page.header.actions %}
{% assign overlay_actions = true %}
{% endif %}
{% endif %}
{% if page.header.overlay_image contains "://" %}
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %}
{% elsif page.header.overlay_image %}
{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %}
{% if page.header.cta_url contains "://" %}
{% capture cta_path %}{{ page.header.cta_url }}{% endcapture %}
{% else %}
{% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% endif %}
{% if page.header.overlay_filter contains "rgba" %}
......@@ -22,18 +51,6 @@
{% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %}
{% endif %}
{% if page.header.type == 'overlay' %}
{% capture img_path %}{{ overlay_img_path }}{% endcapture %}
{% elsif page.header.type == 'image' %}
{% capture img_path %}{{ fixed_img_path }}{% endcapture %}
{% endif %}
{% if page.header.show_text == 'description' %}
{% capture overlay_text %}{{ page.description }}{% endcapture %}
{% elsif page.header.show_text == 'custom' %}
{% capture overlay_text %}{{ page.header.custom_text }}{% endcapture %}
{% endif %}
{% if page.header.image_description %}
{% assign image_description = page.header.image_description %}
{% else %}
......@@ -42,8 +59,8 @@
{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}
<div class="page__hero{% if page.header.type == 'overlay' %}--overlay{% endif %}"
style="{% if page.header.type == 'overlay' %}
<div class="page__hero{% if header_type == 'overlay' %}--overlay{% endif %}"
style="{% if header_type == 'overlay' %}
{% if page.header.color %}
background-color: {{ page.header.color | default: 'transparent' }};
{% endif %}
......@@ -55,9 +72,9 @@
{% endif %}url('{{ img_path }}');
{% endif %}"
>
{% if page.header.type == "overlay" %}
{% if header_type == 'overlay' %}
<div class="wrapper">
{% if page.header.overlay_title %}
{% if overlay_title %}
<h1 id="page-title" class="page__title" itemprop="headline">
{% if paginator and site.paginate_show_page_num %}
{{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}
......@@ -75,7 +92,7 @@
{% if page.header.cta_url %}
<p><a href="{{ cta_path }}" class="btn btn--light-outline btn--large">{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a></p>
{% endif %}
{% if page.header.actions %}
{% if overlay_actions == true and page.header.actions %}
<p>
{% for action in page.header.actions %}
{% if action.url contains "://" %}
......@@ -90,7 +107,11 @@
{% if page.header.caption %}
<span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
{% endif %}
{% elsif page.header.type == 'image' %}
{% elsif header_type == 'image' %}
<img src="{{ img_path }}" alt="{{ img_path }}" class="page__hero-image">
{% elsif page.header_type == 'video' %}
{% capture video_id %}{{ page.header.video.id }}{% endcapture %}
{% capture video_provider %}{{ page.header.video.provider }}{% endcapture %}
{% include video id=video_id provider=video_provider %}
{% endif %}
</div>
{% capture video_id %}{{ page.header.video.id }}{% endcapture %}
{% capture video_provider %}{{ page.header.video.provider }}{% endcapture %}
{% include video id=video_id provider=video_provider %}
......@@ -26,7 +26,7 @@ layout: default
{% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %}
<div class="page__inner-wrap">
{% unless page.header.type == 'overlay' %}
{% unless page.has_header %}
<header>
{% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
{% if page.read_time %}
......
---
last_modified_at: 2019-11-24T17:31:20.000+00:00
toc: true
has_header: true
has_header: false
header:
type: default
type: overlay
overlay_color: rgb(125, 103, 103)
overlay_title: true
show_text: description
overlay_image: "/assets/images/atelier-combat.jpg"
image: ''
show_text: custom
overlay_image: #"/assets/images/atelier-combat.jpg"
custom_text: ''
caption: ''
actions:
- label: Facebook
url: http://facebook.com/
fa-icon: facebook
color: "#B19292"
fixed_image: "/assets/images/banniere-parvis.jpg"
overlay_text: ''
video:
id: rKNMf4LFX44
provider: youtube
title: Lorem Ipsum
classes: ''
classes: 'wide'
description: Description de ouf
share: true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment