Skip to content

Commit 503a1be

Browse files
committed
add post img support
update version to 0.3.2
1 parent d51001b commit 503a1be

File tree

6 files changed

+65
-32
lines changed

6 files changed

+65
-32
lines changed

assets/css/default.css

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,9 @@ code {
133133
}
134134

135135
#blog-list .tag-stats {
136-
height: 5.5rem;
137136
list-style-position: inside;
138137
margin: 0;
139-
padding: 0.8rem 1rem;
138+
padding: 1.4rem 1rem;
140139
text-align: center;
141140
}
142141

@@ -152,7 +151,20 @@ code {
152151
cursor: pointer;
153152
list-style-position: inside;
154153
margin: 0;
155-
padding: 0.6rem 0.8rem;
154+
padding: 0.6rem 0.6rem;
155+
}
156+
157+
.blog-excerpt-img {
158+
margin: 0 0 0.3rem 0;
159+
}
160+
161+
.blog-excerpt-img img {
162+
width: 100%;
163+
max-height: 13rem;
164+
object-fit: cover;
165+
-webkit-border-radius: 0.3rem;
166+
-moz-border-radius: 0.3rem;
167+
border-radius: 0.3rem;
156168
}
157169

158170
.blog-excerpt-title {
@@ -216,16 +228,29 @@ code {
216228
}
217229

218230
.blog-view-container-fix-width {
219-
max-width: 1280px;
220231
min-width: 240px;
221232
padding: 0 1rem;
222233
margin: 0 auto;
223234
}
224235

236+
@media (min-width: 992px) {
237+
.blog-view-container-fix-width {
238+
width: 70%;
239+
}
240+
}
241+
225242
.blog-view-container header {
226243
padding-top: 4rem;
227244
}
228245

246+
.blog-view-img {
247+
width: 100%;
248+
margin-bottom: 1.5rem;
249+
-webkit-border-radius: 0.5rem;
250+
-moz-border-radius: 0.5rem;
251+
border-radius: 0.5rem;
252+
}
253+
229254
.blog-view-title {
230255
margin-bottom: 0.8rem;
231256
text-align: center;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "everblog",
33
"description": "A three rows layout ghost blog theme",
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"engines": {
66
"ghost": ">=1.0.0"
77
},

partials/blog-list.hbs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
<div class="list-group scroll">
33
<div class="list-container">
44
{{#foreach posts}}
5-
<article href="{{url}}" class="list-group-item blog-excerpt {{post_class}}" onclick="loadBlog(this)">
6-
<div class="blog-excerpt-title text-overflow">
7-
{{{title}}}
8-
</div>
9-
<div class="blog-excerpt-date text-overflow">
10-
{{date format="YYYY-MM-DD"}}
11-
</div>
12-
<div class="blog-excerpt-content">
13-
{{excerpt characters="120"}}
14-
</div>
15-
</article>
5+
{{> blog_excerpt}}
166
{{/foreach}}
177
</div>
188
{{pagination}}

partials/blog-view.hbs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
<div class="row">
33
<header id="blog-view-header" class="headroom">
44
<div>
5-
<button onclick="javascript:smallScreenPageChange(1)" class="btn">< Back</button>
5+
<button onclick="smallScreenPageChange(1)" class="btn">< Back</button>
66
</div>
77
</header>
88
<article class="blog-view-container {{post_class}}">
99
<div class="blog-view-container-fix-width">
1010
<header>
11+
{{#if feature_image}}
12+
<img class="blog-view-img" src="{{img_url feature_image}}">
13+
{{/if}}
1114
<div class="blog-view-title">
1215
{{title}}
1316
</div>

partials/blog_excerpt.hbs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{#if feature_image}}
2+
<article href="{{url}}" class="list-group-item blog-excerpt {{post_class}}" onclick="loadBlog(this)">
3+
<div class="blog-excerpt-img">
4+
<img src="{{img_url feature_image}}"/>
5+
</div>
6+
<div class="blog-excerpt-title text-overflow">
7+
{{{title}}}
8+
</div>
9+
<div class="blog-excerpt-date text-overflow">
10+
{{date format="YYYY-MM-DD"}}
11+
</div>
12+
</article>
13+
{{else}}
14+
<article href="{{url}}" class="list-group-item blog-excerpt {{post_class}}" onclick="loadBlog(this)">
15+
<div class="blog-excerpt-title text-overflow">
16+
{{{title}}}
17+
</div>
18+
<div class="blog-excerpt-date text-overflow">
19+
{{date format="YYYY-MM-DD"}}
20+
</div>
21+
<div class="blog-excerpt-content">
22+
{{excerpt characters="180"}}
23+
</div>
24+
</article>
25+
{{/if}}

partials/tag-blog-list.hbs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,15 @@
22
<div class="list-group scroll">
33
<header class="list-group-item tag-stats">
44
<div class="tag-stats-header">
5-
{{tag.name}}
5+
{{tag.name}}
66
</div>
77
<div class="tag-stats-count">
88
{{pagination.total}} articles
99
</div>
1010
</header>
11-
{{#foreach posts}}
12-
<article href="{{url}}" class="list-group-item blog-excerpt {{post_class}}" onclick="loadBlog(this)">
13-
<div class="blog-excerpt-title text-overflow">
14-
{{{title}}}
15-
</div>
16-
<div class="blog-excerpt-date text-overflow">
17-
{{date format="YYYY-MM-DD"}}
18-
</div>
19-
<div class="blog-excerpt-content">
20-
{{excerpt characters="180"}}
21-
</div>
22-
</article>
23-
{{/foreach}}
11+
{{#foreach posts}}
12+
{{> blog_excerpt}}
13+
{{/foreach}}
2414
</div>
25-
{{pagination}}
15+
{{pagination}}
2616
</div>

0 commit comments

Comments
 (0)