hacks-guide-minimal-mistake.../test/_posts/2012-03-15-layout-header-overlay-image.md
Michael Rose 57a4324fa0 Move gh-pages branch files into /docs and add test files
- Jekyll ignore `/docs` and `/test` folders when using from root
- Update Staticman config to point to correct branch and data file location
- Replace `{{ base_path }}` references with `absolute_url` filter
- Update documentation
2016-11-03 11:52:04 -04:00

1.4 KiB

title header categories tags modified
Layout: Header Image Overlay
overlay_image caption cta_url
/assets/images/unsplash-image-1.jpg Photo credit: [**Unsplash**](https://unsplash.com) https://unsplash.com
Layout
Uncategorized
edge case
image
layout
2016-05-02T11:39:01-04:00

{% include base_path %}

This post should display a header with an overlay image, if the theme supports it.

Non-square images can provide some unique styling issues.

This post tests overlay header images.

Overlay filter

You can use it by specifying the opacity (between 0 and 1) of a black overlay like so:

![transparent black overlay]({{ basepath }}/assets/images/mm-header-overlay-black-filter.jpg)

excerpt: "This post should [...]"
header:
  overlay_image: /assets/images/unsplash-image-1.jpg
  overlay_filter: 0.5 # same as adding an opacity of 0.5 to a black background
  caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
  cta_label: "More Info"
  cta_url: "https://unsplash.com"

Or if you want to do more fancy things, go full rgba:

![transparent red overlay]({{ basepath }}/assets/images/mm-header-overlay-red-filter.jpg)

excerpt: "This post should [...]"
header:
  overlay_image: /assets/images/unsplash-image-1.jpg
  overlay_filter: rgba(255, 0, 0, 0.5)
  caption: "Photo credit: [**Unsplash**](https://unsplash.com)"
  cta_label: "More Info"
  cta_url: "https://unsplash.com"