diff --git a/_includes/page__hero.html b/_includes/page__hero.html index 7d43bca58b6153f54b73fd53e7aaf0dc9b34fc8f..9247552cdcab297443884786e2ecd350efe3fabc 100644 --- a/_includes/page__hero.html +++ b/_includes/page__hero.html @@ -1,7 +1,7 @@ -{% if page.header.image contains "://" %} - {% capture img_path %}{{ page.header.image }}{% endcapture %} +{% if page.header.fixed_image contains "://" %} + {% capture fixed_img_path %}{{ page.header.fixed_image}}{% endcapture %} {% else %} - {% capture img_path %}{{ page.header.image | relative_url }}{% endcapture %} + {% capture fixed_img_path %}{{ page.header.fixed_image | relative_url }}{% endcapture %} {% endif %} {% if page.header.cta_url contains "://" %} @@ -10,12 +10,10 @@ {% capture cta_path %}{{ page.header.cta_url | relative_url }}{% endcapture %} {% endif %} -{% if page.overlay_image contains "://" %} - {% capture overlay_img_path %}{{ page.overlay_image }}{% endcapture %} +{% if page.header.overlay_image contains "://" %} + {% capture overlay_img_path %}{{ page.header.overlay_image }}{% endcapture %} {% elsif page.overlay_image %} - {% capture overlay_img_path %}{{ page.overlay_image | relative_url }}{% endcapture %} -{% elsif author.banner %} - {% capture overlay_img_path %}{{ author.banner | relative_url }}{% endcapture %} + {% capture overlay_img_path %}{{ page.header.overlay_image | relative_url }}{% endcapture %} {% endif %} {% if page.header.overlay_filter contains "rgba" %} @@ -24,6 +22,18 @@ {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} {% endif %} +{% if page.header.type == 'fixed_image' %} + {% capture img_path %}{{ page.header.fixed_image }}{% endcapture %} +{% elsif page.header.type == 'overlay_image' %} + {% capture img_path %}{{ page.header.overlay_image }}{% 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 %} @@ -32,42 +42,40 @@ {% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} -<div class="page__hero{% if page.header.overlay_color or page.overlay_image or author.banner %}--overlay{% endif %}" - style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if overlay_img_path %}background-image: {% if overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}), {% endif %}url('{{ overlay_img_path }}');{% endif %}" +<div class="page__hero{% unless page.header.header_type == 'image-fixed' %}--overlay{% endunless %}" + style="{% if page.header.overlay_color %}background-color: {{ page.header.overlay_color | default: 'transparent' }};{% endif %} {% if page.header.type contains 'image' %}background-image: {% if overlay_filter %}linear-gradient({{ overlay_filter }}, {{ overlay_filter }}), {% endif %}url('{{ img_path }}');{% endif %}" > - {% if page.overlay_image or author.banner %} - <div class="wrapper"> - <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 %} - {% else %} - {{ page.title | default: site.title | markdownify | remove: "<p>" | remove: "</p>" }} - {% endif %} - </h1> - {% if page.header.show_overlay_excerpt != false and page.excerpt %} - <p class="page__lead">{{ page.excerpt | markdownify | remove: "<p>" | remove: "</p>" }}</p> - {% endif %} - {% if page.read_time %} - <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> {% include read-time.html %}</p> + <div class="wrapper"> + {% if page.header.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 %} + {% else %} + {{ page.title | default: site.title | markdownify | remove: "<p>" | remove: "</p>" }} {% endif %} - {% 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 %} - <p> - {% for action in page.header.actions %} - {% if action.url contains "://" %} - {% assign url = action.url %} - {% else %} - {% assign url = action.url | relative_url %} - {% endif %} - <a href="{{ url }}" class="btn btn--light-outline btn--large">{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a> - {% endfor %} + </h1> + {% endif %} + {% if overlay_text %} + <p class="page__lead">{{ overlay_text | markdownify | remove: "<p>" | remove: "</p>" }}</p> + {% endif %} + {% if page.read_time %} + <p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i> {% include read-time.html %}</p> + {% endif %} + {% 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 %} + <p> + {% for action in page.header.actions %} + {% if action.url contains "://" %} + {% assign url = action.url %} + {% else %} + {% assign url = action.url | relative_url %} {% endif %} - </div> - {% else %} - <img src="{{ img_path }}" alt="{{ image_description }}" class="page__hero-image"> + <a href="{{ url }}" class="btn btn--light-outline btn--large">{{ action.label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}</a> + {% endfor %} {% endif %} + </div> {% if page.header.caption %} <span class="page__hero-caption">{{ page.header.caption | markdownify | remove: "<p>" | remove: "</p>" }}</span> {% endif %} diff --git a/_layouts/single.html b/_layouts/single.html index f5f4f52b90c5a7989788a154d7056e48e77dae8d..1d174585ec22ce2901418e7ff0bcce5b78be6790 100644 --- a/_layouts/single.html +++ b/_layouts/single.html @@ -6,10 +6,8 @@ layout: default {% assign author = author[1] %} {% assign author = site.data.authors.authors | where: "directory", author | first %} -{% if page.header.overlay_color or page.overlay_image or page.header.image or author.banner %} +{% if page.has_header %} {% include page__hero.html %} -{% elsif page.header.video.id and page.header.video.provider %} - {% include page__hero_video.html %} {% endif %} {% if page.url != "/" and site.breadcrumbs %}