File tree Expand file tree Collapse file tree 4 files changed +43
-5
lines changed Expand file tree Collapse file tree 4 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 33{% block content %}
44
55 <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+ />
612 {{ post .content }}
713 </div >
814
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 %}
511 <div >
6- {{ post .preview }}
12+ <h2 class =" post-preview__title" >
13+ {{ post .title }}
14+ </h2 >
15+ <div >
16+ {{ post .preview }}
17+ </div >
718 </div >
819</article >
Original file line number Diff line number Diff line change 6464// and our UI components are often composed of Objects and Components
6565@import ' components/main-nav' ;
6666@import ' components/pagination' ;
67+ @import ' components/post-preview' ;
6768@import ' components/primary-sidebar' ;
6869@import ' components/post-body' ;
6970@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