Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teaser images in list of posts and archive #1717

Closed
luispuerto opened this issue Jun 24, 2018 · 7 comments
Closed

Teaser images in list of posts and archive #1717

luispuerto opened this issue Jun 24, 2018 · 7 comments

Comments

@luispuerto
Copy link
Contributor

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


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: luispuerto/luispuerto-net@6d434f0?diff=unified

@luispuerto luispuerto changed the title Teaser images in list of post and archive Teaser images in list of posts and archive Jun 24, 2018
@mmistakes
Copy link
Owner

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

@luispuerto
Copy link
Contributor Author

Thanks a lot! I'll take a look 😃

@luispuerto
Copy link
Contributor Author

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

@RichStone
Copy link

RichStone commented Aug 4, 2018

@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..

@mmistakes mmistakes mentioned this issue Oct 4, 2018
@karrot42
Copy link

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.

@fjp
Copy link

fjp commented Nov 28, 2019

@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 %}

@haiddy
Copy link

haiddy commented Feb 6, 2023

i had a problem and teaser doesn't work with me but it was solved when i added _sass folder to my repo

okitem pushed a commit to okmalls/okmalls.github.io that referenced this issue Sep 21, 2024
Improved the data structure for defining resource hints to the browser.
okitem pushed a commit to okmalls/okmalls.github.io that referenced this issue Sep 21, 2024
## [7.0.0](cotes2020/jekyll-theme-chirpy@v6.5.5...v7.0.0) (2024-05-11)

### ⚠ BREAKING CHANGES

* optimize the resource hints (mmistakes#1717)
* rename media-url file and related parameters (mmistakes#1651)
* rename comment setting parameter (mmistakes#1563)
* **analytics:** add post pageviews for GoatCounter (mmistakes#1543)

### Features

* add cloudflare web analytics ([mmistakes#1723](cotes2020/jekyll-theme-chirpy#1723)) ([c17fba4](cotes2020/jekyll-theme-chirpy@c17fba4))
* add support for embed video files ([mmistakes#1558](cotes2020/jekyll-theme-chirpy#1558)) ([9592146](cotes2020/jekyll-theme-chirpy@9592146))
* add support for giscus strict title matching ([mmistakes#1614](cotes2020/jekyll-theme-chirpy#1614)) ([700fd5b](cotes2020/jekyll-theme-chirpy@700fd5b))
* **analytics:** add post pageviews for GoatCounter ([mmistakes#1543](cotes2020/jekyll-theme-chirpy#1543)) ([b641b3f](cotes2020/jekyll-theme-chirpy@b641b3f))
* **analytics:** add Umami and Matomo tracking codes ([mmistakes#1658](cotes2020/jekyll-theme-chirpy#1658)) ([61bdca2](cotes2020/jekyll-theme-chirpy@61bdca2))
* change site verification settings ([mmistakes#1561](cotes2020/jekyll-theme-chirpy#1561)) ([e436387](cotes2020/jekyll-theme-chirpy@e436387))
* **deps:** move `MathJax` configuration to a separate file ([mmistakes#1670](cotes2020/jekyll-theme-chirpy#1670)) ([44f552c](cotes2020/jekyll-theme-chirpy@44f552c))
* display theme version in footer ([mmistakes#1611](cotes2020/jekyll-theme-chirpy#1611)) ([8349314](cotes2020/jekyll-theme-chirpy@8349314))
* **i18n:** allow `page.lang` to override `site.lang` ([mmistakes#1586](cotes2020/jekyll-theme-chirpy#1586)) ([547b95c](cotes2020/jekyll-theme-chirpy@547b95c))
* make post description customizable ([mmistakes#1602](cotes2020/jekyll-theme-chirpy#1602)) ([f865336](cotes2020/jekyll-theme-chirpy@f865336))
* **media:** support audio and video tag with multi sources ([mmistakes#1618](cotes2020/jekyll-theme-chirpy#1618)) ([23be416](cotes2020/jekyll-theme-chirpy@23be416))

### Bug Fixes

* make TOC title and entries visible at the same time ([mmistakes#1711](cotes2020/jekyll-theme-chirpy#1711)) ([e0950fc](cotes2020/jekyll-theme-chirpy@e0950fc))
* mode toggle not outlined when receiving keyboard focus ([mmistakes#1690](cotes2020/jekyll-theme-chirpy#1690)) ([cd37f63](cotes2020/jekyll-theme-chirpy@cd37f63))
* prevent footnote back arrow from becoming an emoji ([mmistakes#1716](cotes2020/jekyll-theme-chirpy#1716)) ([8608147](cotes2020/jekyll-theme-chirpy@8608147))
* **pwa:** skip range requests in service worker ([mmistakes#1672](cotes2020/jekyll-theme-chirpy#1672)) ([76d58fe](cotes2020/jekyll-theme-chirpy@76d58fe))
* search result prompt is empty ([mmistakes#1583](cotes2020/jekyll-theme-chirpy#1583)) ([8a2afae](cotes2020/jekyll-theme-chirpy@8a2afae))
* use `https` for Weibo sharing URL ([mmistakes#1612](cotes2020/jekyll-theme-chirpy#1612)) ([8e5fbb7](cotes2020/jekyll-theme-chirpy@8e5fbb7))

### Improvements

* improve <hr> visibility in dark mode ([mmistakes#1565](cotes2020/jekyll-theme-chirpy#1565)) ([4ddd5c4](cotes2020/jekyll-theme-chirpy@4ddd5c4))
* lean bootstrap javascript ([mmistakes#1734](cotes2020/jekyll-theme-chirpy#1734)) ([ddb48ed](cotes2020/jekyll-theme-chirpy@ddb48ed))
* rename comment setting parameter ([mmistakes#1563](cotes2020/jekyll-theme-chirpy#1563)) ([f8390d4](cotes2020/jekyll-theme-chirpy@f8390d4))
* replace jQuery with Vanilla JS ([mmistakes#1681](cotes2020/jekyll-theme-chirpy#1681)) ([fe7afa3](cotes2020/jekyll-theme-chirpy@fe7afa3))
* simplify mode toggle script ([mmistakes#1692](cotes2020/jekyll-theme-chirpy#1692)) ([d4a6d64](cotes2020/jekyll-theme-chirpy@d4a6d64))
* tree shaking Bootstrap CSS ([mmistakes#1736](cotes2020/jekyll-theme-chirpy#1736)) ([363a3d9](cotes2020/jekyll-theme-chirpy@363a3d9))

### Changes

* optimize the resource hints ([mmistakes#1717](cotes2020/jekyll-theme-chirpy#1717)) ([dcb0add](cotes2020/jekyll-theme-chirpy@dcb0add))
* rename media-url file and related parameters ([mmistakes#1651](cotes2020/jekyll-theme-chirpy#1651)) ([9f8aeaa](cotes2020/jekyll-theme-chirpy@9f8aeaa))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants