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: ...@@ -278,9 +278,6 @@ defaults:
values: values:
layout: single layout: single
author_profile: true author_profile: true
share: true
toc_sticky: true toc_sticky: true
header:
show_overlay_excerpt: false
sidebar: sidebar:
nav: true nav: true
{% if page.header.cta_url contains "://" %} {% if page.header.type == 'default' %}
{% capture cta_path %}{{ page.header.cta_url }}{% endcapture %} {% 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 %} {% else %}
{% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% endif %}
{% if page.header.fixed_image contains "://" %} {% capture header_type %}{{ page.header.type }}{% endcapture %}
{% capture fixed_img_path %}{{ page.header.fixed_image}}{% endcapture %}
{% else %} {% if page.header.fixed_image contains "://" %}
{% capture fixed_img_path %}{{ page.header.fixed_image | relative_url }}{% endcapture %} {% 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 %} {% endif %}
{% if page.header.overlay_image contains "://" %} {% if page.header.cta_url contains "://" %}
{% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %} {% capture cta_path %}{{ page.header.cta_url }}{% endcapture %}
{% elsif page.header.overlay_image %} {% else %}
{% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} {% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %}
{% endif %} {% endif %}
{% if page.header.overlay_filter contains "rgba" %} {% if page.header.overlay_filter contains "rgba" %}
...@@ -22,18 +51,6 @@ ...@@ -22,18 +51,6 @@
{% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %}
{% endif %} {% 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 %} {% if page.header.image_description %}
{% assign image_description = page.header.image_description %} {% assign image_description = page.header.image_description %}
{% else %} {% else %}
...@@ -42,8 +59,8 @@ ...@@ -42,8 +59,8 @@
{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %}
<div class="page__hero{% if page.header.type == 'overlay' %}--overlay{% endif %}" <div class="page__hero{% if header_type == 'overlay' %}--overlay{% endif %}"
style="{% if page.header.type == 'overlay' %} style="{% if header_type == 'overlay' %}
{% if page.header.color %} {% if page.header.color %}
background-color: {{ page.header.color | default: 'transparent' }}; background-color: {{ page.header.color | default: 'transparent' }};
{% endif %} {% endif %}
...@@ -55,9 +72,9 @@ ...@@ -55,9 +72,9 @@
{% endif %}url('{{ img_path }}'); {% endif %}url('{{ img_path }}');
{% endif %}" {% endif %}"
> >
{% if page.header.type == "overlay" %} {% if header_type == 'overlay' %}
<div class="wrapper"> <div class="wrapper">
{% if page.header.overlay_title %} {% if overlay_title %}
<h1 id="page-title" class="page__title" itemprop="headline"> <h1 id="page-title" class="page__title" itemprop="headline">
{% if paginator and site.paginate_show_page_num %} {% 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 %} {{ site.title }}{% unless paginator.page == 1 %} {{ site.data.ui-text[site.locale].page | default: "Page" }} {{ paginator.page }}{% endunless %}
...@@ -75,7 +92,7 @@ ...@@ -75,7 +92,7 @@
{% if page.header.cta_url %} {% 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> <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 %} {% endif %}
{% if page.header.actions %} {% if overlay_actions == true and page.header.actions %}
<p> <p>
{% for action in page.header.actions %} {% for action in page.header.actions %}
{% if action.url contains "://" %} {% if action.url contains "://" %}
...@@ -90,7 +107,11 @@ ...@@ -90,7 +107,11 @@
{% if page.header.caption %} {% if page.header.caption %}
<span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span> <span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
{% endif %} {% endif %}
{% elsif page.header.type == 'image' %} {% elsif header_type == 'image' %}
<img src="{{ img_path }}" alt="{{ img_path }}" class="page__hero-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 %} {% endif %}
</div> </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 ...@@ -26,7 +26,7 @@ layout: default
{% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %} {% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %}
<div class="page__inner-wrap"> <div class="page__inner-wrap">
{% unless page.header.type == 'overlay' %} {% unless page.has_header %}
<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.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
{% if page.read_time %} {% if page.read_time %}
......
--- ---
last_modified_at: 2019-11-24T17:31:20.000+00:00 last_modified_at: 2019-11-24T17:31:20.000+00:00
toc: true toc: true
has_header: true has_header: false
header: header:
type: default type: overlay
overlay_color: rgb(125, 103, 103) overlay_color: rgb(125, 103, 103)
overlay_title: true overlay_title: true
show_text: description show_text: custom
overlay_image: "/assets/images/atelier-combat.jpg" overlay_image: #"/assets/images/atelier-combat.jpg"
image: ''
custom_text: '' custom_text: ''
caption: '' caption: ''
actions: actions:
- label: Facebook
url: http://facebook.com/
fa-icon: facebook
color: "#B19292" color: "#B19292"
fixed_image: "/assets/images/banniere-parvis.jpg" fixed_image: "/assets/images/banniere-parvis.jpg"
overlay_text: '' overlay_text: ''
video:
id: rKNMf4LFX44
provider: youtube
title: Lorem Ipsum title: Lorem Ipsum
classes: '' classes: 'wide'
description: Description de ouf description: Description de ouf
share: true 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