Skip to content

Commit

Permalink
Added thumbnail support for blog posts (alshedivat#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
george-gca authored and wangmagg committed May 14, 2024
1 parent d5556a6 commit 290d508
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions _posts/2015-05-15-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ date: 2015-05-15 21:01:00
description: this is what included images could look like
tags: formatting images
categories: sample-posts
thumbnail: assets/img/9.jpg
---
This is an example post with image galleries.

Expand Down
13 changes: 12 additions & 1 deletion blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ <h2>{{ site.blog_description }}</h2>
{% assign categories = post.categories | join: "" %}

<li>
<h3>
{%- if post.thumbnail -%}
<div class="row">
<div class="col-sm-9">
{%- endif -%}
<h3>
{% if post.redirect == blank %}
<a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
{% else %}
Expand Down Expand Up @@ -95,6 +99,13 @@ <h3>
{% endfor %}
{% endif %}
</p>
{%- if post.thumbnail -%}
</div>
<div class="col-sm-3">
<img class="card-img" src="{{post.thumbnail | relative_url}}" style="object-fit: cover; height: 90%" alt="image">
</div>
</div>
{%- endif -%}
</li>

{% endfor %}
Expand Down

0 comments on commit 290d508

Please sign in to comment.