From 4926262d27b3266a85d9a34a69a87a896ee770c4 Mon Sep 17 00:00:00 2001 From: "Brian (bex) Exelbierd" Date: Sun, 22 Jul 2018 23:54:18 +0200 Subject: [PATCH] Add override to get time in overlays Submitted upstream as: https://github.com/mmistakes/minimal-mistakes/pull/1756 --- _includes/page__hero.html | 61 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 _includes/page__hero.html diff --git a/_includes/page__hero.html b/_includes/page__hero.html new file mode 100644 index 0000000..0438720 --- /dev/null +++ b/_includes/page__hero.html @@ -0,0 +1,61 @@ +{% if page.header.image contains "://" %} + {% capture img_path %}{{ page.header.image }}{% endcapture %} +{% else %} + {% capture img_path %}{{ page.header.image | relative_url }}{% endcapture %} +{% endif %} + +{% 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_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 page.header.overlay_filter contains "rgba" %} + {% capture overlay_filter %}{{ page.header.overlay_filter }}{% endcapture %} +{% elsif page.header.overlay_filter %} + {% capture overlay_filter %}rgba(0, 0, 0, {{ page.header.overlay_filter }}){% endcapture %} +{% endif %} + +{% if page.header.image_description %} + {% assign image_description = page.header.image_description %} +{% else %} + {% assign image_description = page.title %} +{% endif %} + +{% assign image_description = image_description | markdownify | strip_html | strip_newlines | escape_once %} + +
+ {% if page.header.overlay_color or page.header.overlay_image %} +
+

+ {% 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: "

" | remove: "

" }} + {% endif %} +

+ {% if page.header.show_overlay_excerpt != false and page.excerpt %} +

{{ page.excerpt | markdownify | remove: "

" | remove: "

" }}

+ {% endif %} + {% if site.read_time or page.read_time %} +

{% include read-time.html %}

+ {% endif %} + {% if page.header.cta_url %} +

{{ page.header.cta_label | default: site.data.ui-text[site.locale].more_label | default: "Learn More" }}

+ {% endif %} +
+ {% else %} + {{ image_description }} + {% endif %} + {% if page.header.caption %} + {{ page.header.caption | markdownify | remove: "

" | remove: "

" }}
+ {% endif %} +