File tree 4 files changed +43
-5
lines changed
4 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 3
3
{% block content %}
4
4
5
5
<div class =" obj-width-limiter" >
6
+ <img
7
+ src =" {{ post .thumbnail .src | resize(960 ) }}"
8
+ {% if post .thumbnail .alt and post .thumbnail .alt | length > 0 %}
9
+ alt =" {{ post .thumbnail .alt }}"
10
+ {% endif %}
11
+ />
6
12
{{ post .content }}
7
13
</div >
8
14
Original file line number Diff line number Diff line change 1
- <article id =" post-{{ post .id }}" >
2
- <h2 >
3
- {{ post .title }}
4
- </h2 >
1
+ <article id =" post-{{ post .id }}" class =" post-preview" >
2
+ {% if post .thumbnail %}
3
+ <img
4
+ src =" {{ post .thumbnail .src (' thumbnail' ) }}"
5
+ class =" post-preview__featured-image"
6
+ {% if post .thumbnail .alt and post .thumbnail .alt | length > 0 %}
7
+ alt =" {{ post .thumbnail .alt }}"
8
+ {% endif %}
9
+ />
10
+ {% endif %}
5
11
<div >
6
- {{ post .preview }}
12
+ <h2 class =" post-preview__title" >
13
+ {{ post .title }}
14
+ </h2 >
15
+ <div >
16
+ {{ post .preview }}
17
+ </div >
7
18
</div >
8
19
</article >
Original file line number Diff line number Diff line change 64
64
// and our UI components are often composed of Objects and Components
65
65
@import ' components/main-nav' ;
66
66
@import ' components/pagination' ;
67
+ @import ' components/post-preview' ;
67
68
@import ' components/primary-sidebar' ;
68
69
@import ' components/post-body' ;
69
70
@import ' components/skip-to-content' ;
Original file line number Diff line number Diff line change
1
+ .post-preview {
2
+ margin-bottom : 1.5rem ;
3
+ min-height : 9.375rem ; // 150px
4
+
5
+ @media (min-width : 50rem ) {
6
+ display : flex ;
7
+ column-gap : 1.5rem ;
8
+ }
9
+
10
+ & __title {
11
+ margin : 0 0 1rem ;
12
+ }
13
+
14
+ & __featured-image {
15
+ max-height : 9.375rem ; // 150px
16
+ max-width : 9.375rem ; // 150px
17
+ width : auto ;
18
+ height : auto ;
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments