~xdavidwu/xdavidwu.link

f90b00603af94aeef55b05667530956a97d29f11 — Michael Rose 6 years ago 2d7f05d
Add support for captioning images in feature row helper

Use `image_caption` YAML front matter to assign a caption to the feature image, Markdown is allowed.

Close #1440
3 files changed, 31 insertions(+), 0 deletions(-)

M CHANGELOG.md
M _includes/feature_row
M _sass/minimal-mistakes/_archive.scss
M CHANGELOG.md => CHANGELOG.md +1 -0
@@ 2,6 2,7 @@

### Enhancements

* Add support for captioning images in feature row helper via `image_caption` YAML Front Matter. [#1440](https://github.com/mmistakes/minimal-mistakes/issues/1440)
* Add [Google Custom Search Engine](https://cse.google.com/cse) support. [#1652](https://github.com/mmistakes/minimal-mistakes/issues/1652)
* Update Font Awesome to version [`5.0.13`](https://github.com/FortAwesome/Font-Awesome/blob/master/CHANGELOG.md)
* Add "Pets" sample archive page to documentation site. [#1664](https://github.com/mmistakes/minimal-mistakes/pull/1664)

M _includes/feature_row => _includes/feature_row +3 -0
@@ 25,6 25,9 @@
                "{{ f.image_path | relative_url }}"
              {% endif %}
            alt="{% if f.alt %}{{ f.alt }}{% endif %}">
            {% if f.image_caption %}
              <span class="archive__item-caption">{{ f.image_caption | markdownify | remove: "<p>" | remove: "</p>" }}</span>
            {% endif %}
          </div>
        {% endif %}


M _sass/minimal-mistakes/_archive.scss => _sass/minimal-mistakes/_archive.scss +27 -0
@@ 63,13 63,40 @@
}

.archive__item-teaser {
  position: relative;
  border-radius: $border-radius;
  overflow: hidden;

  img {
    width: 100%;
  }
}

.archive__item-caption {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0 auto;
  padding: 2px 5px;
  color: #fff;
  font-family: $caption-font-family;
  font-size: $type-size-8;
  background: #000;
  text-align: right;
  z-index: 5;
  opacity: 0.5;
  border-radius: $border-radius 0 0 0;

  @include breakpoint($large) {
    padding: 5px 10px;
  }

  a {
    color: #fff;
    text-decoration: none;
  }
}

/*
   List view
   ========================================================================== */