Skip to content

Commit 1daaca6

Browse files
dvhartmmistakes
authored andcommitted
v2: Introduce show_overlay_excerpt and document (mmistakes#1436)
Make excerpts optional in header overlay Some posts and some header images don't lend themselves well to displaying the excerpt in the overlay. Make this optional by introducting a new boolean variable: `page.header.show_overlay_excerpt` Set it to implicitly default to `true` so existing users are unaffected by testing explicitly for "!= false". This can be enabled globally for a site by changing the default to `false` in the local _config.yml, or per page by specifying the value in front matter. Document show_overlay_excerpt variable * Add show_overlay_excerpt variable to the Header Overlay field documentation table. Close mmistakes#1429
1 parent 171d372 commit 1daaca6

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

_includes/page__hero.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1 class="page__title" itemprop="headline">
4242
{{ page.title | default: site.title | markdownify | remove: "<p>" | remove: "</p>" }}
4343
{% endif %}
4444
</h1>
45-
{% if page.excerpt %}
45+
{% if page.header.show_overlay_excerpt != false and page.excerpt %}
4646
<p class="page__lead">{{ page.excerpt | markdownify | remove: "<p>" | remove: "</p>" }}</p>
4747
{% endif %}
4848
{% if site.read_time and page.read_time %}

docs/_docs/10-layouts.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,14 @@ header:
339339

340340
To overlay text on top of a header image you have a few more options:
341341

342-
| Name | Description | Default |
343-
| ---- | ----------- | ------- |
344-
| **overlay_image** | Header image you'd like to overlay. Same rules as `header.image` from above. | |
345-
| **overlay_filter** | Color/opacity to overlay on top of the header image eg: `0.5` or `rgba(255, 0, 0, 0.5)`. |
346-
| **excerpt** | Auto-generated page excerpt is added to the overlay text or can be overridden. | |
347-
| **cta_label** | Call to action button text label. | `more_label` in UI Text data file |
348-
| **cta_url** | Call to action button URL. | |
342+
| Name | Description | Default |
343+
| ---- | ----------- | ------- |
344+
| **overlay_image** | Header image you'd like to overlay. Same rules as `header.image` from above. | |
345+
| **overlay_filter** | Color/opacity to overlay on top of the header image eg: `0.5` or `rgba(255, 0, 0, 0.5)`. |
346+
| **show_overlay_excerpt** | Display excerpt in the overlay text | true |
347+
| **excerpt** | Auto-generated page excerpt is added to the overlay text or can be overridden. | |
348+
| **cta_label** | Call to action button text label. | `more_label` in UI Text data file |
349+
| **cta_url** | Call to action button URL. | |
349350

350351
With this YAML Front Matter:
351352

0 commit comments

Comments
 (0)