Minimal-mistakes: Teaser images in list of posts and archive

Created on 24 Jun 2018  路  6Comments  路  Source: mmistakes/minimal-mistakes

First of all, thanks for this theme! it's really awesome!

Description

I would like to have a list of posts with showing the teaser images each post, so i decided to remove the {% if include.type == "grid" and teaser %} and {% endif %} from _includes/archive-single.html. Resulting in:

<div class="{{ include.type | default: "list" }}__item">
  <article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
      <div class="archive__item-teaser">
        <img src=
          {% if teaser contains "://" %}
            "{{ teaser }}"
          {% else %}
            "{{ teaser | relative_url }}"
          {% endif %}
          alt="">
      </div>

I don't know if this is a correct approach or there is another more elegant way to go.

Environment

  • Minimal Mistakes version: 4.12.0
  • Ruby gem or remote theme version: 2.7.6
  • Jekyll version: 3.8.3
  • Git repository URL: https://github.com/luisspuerto/jekyll.luisspuerto.net/
  • Operating system: macOS 10.13.5
  • GitHub Pages hosted (if yes provide URL to site): jekyll.luisspuerto.net

Expected behavior

This... or similar:
luis puerto 2018-06-24 17-23-01 utc

Steps to reproduce the behavior

Remove the {% if include.type == "grid" and teaser %} and {% endif %} from _includes/archive-single.html

You can see the commit here: https://github.com/luisspuerto/jekyll.luisspuerto.net/commit/6d434f0252b7b31ec9db9ad4e1f646582339a3da?diff=unified

Support

Most helpful comment

@karrot42 in case you still need it, change and to or in the following line in _includes/archive_single.html:

{% if include.type == "grid" or teaser %}

All 6 comments

Have a look at @justinrummel's repo, he's customized the theme to do this if you wanted some ideas.

https://github.com/justinrummel/jr.com-mm

Thanks a lot! I'll take a look 馃槂

I did it and I'm very happy with the result. Thanks for the inspiration.

@mmistakes Hey Michael, what's the reason you wouldn't integrate it in the official minimal-mistakes theme? Is there an alternative incorporated into your theme to list recent posts automatically with its header/teaser image together? I haven't found anything so far..

I did it and I'm very happy with the result. Thanks for the inspiration.

If you could, could you please elaborate on what you did? I can't find out where the other theme was modified to get your desired results.

@karrot42 in case you still need it, change and to or in the following line in _includes/archive_single.html:

{% if include.type == "grid" or teaser %}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

deepaksood619 picture deepaksood619  路  5Comments

asarkar picture asarkar  路  4Comments

alkamid picture alkamid  路  4Comments

floatingpurr picture floatingpurr  路  3Comments

satwikkansal picture satwikkansal  路  4Comments