Skip to content

Commit d40bffe

Browse files
committed
Restore post count beside topics
1 parent 00ccccc commit d40bffe

2 files changed

Lines changed: 30 additions & 2 deletions

File tree

layouts/_default/list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h3><a href="{{ .Permalink }}">{{ .Title }}</a> <span class="tag">{{ .FirstSecti
1010
<div class="meta">
1111
{{ with .Params.author }}{{ . }} · {{ end }}{{ .Date.Format "January 2, 2006" }}
1212
</div>
13-
<p>{{ truncate 250 .Plain }}</p>
13+
<div class="summary-box">{{ .Summary }}</div>
1414
<a href="{{ .Permalink }}">Read more →</a>
1515
</div>
1616
{{ end }}
@@ -39,7 +39,7 @@ <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
3939
<div class="meta">
4040
{{ with .Params.author }}{{ . }} · {{ end }}{{ .Date.Format "January 2, 2006" }}
4141
</div>
42-
<p>{{ truncate 250 .Plain }}</p>
42+
<div class="summary-box">{{ .Summary }}</div>
4343
<a href="{{ .Permalink }}">Read more →</a>
4444
</div>
4545
{{ end }}

static/css/style.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,34 @@ a.tag:hover {
370370
text-decoration: underline;
371371
}
372372

373+
/* Summary box for posts without description */
374+
.summary-box {
375+
background: var(--color-surface);
376+
border: 1px solid var(--color-border-muted);
377+
border-radius: 4px;
378+
padding: 0.75rem 1rem;
379+
font-size: 0.85rem;
380+
color: var(--color-text-muted);
381+
margin-bottom: 0.5rem;
382+
max-height: 12rem;
383+
overflow: hidden;
384+
}
385+
386+
.summary-box h1,
387+
.summary-box h2,
388+
.summary-box h3,
389+
.summary-box h4 {
390+
font-size: 0.85rem;
391+
margin: 0.25rem 0;
392+
border: none;
393+
padding: 0;
394+
}
395+
396+
.summary-box img {
397+
max-height: 4rem;
398+
margin: 0.25rem 0;
399+
}
400+
373401
/* Footer */
374402
footer {
375403
margin-top: 3rem;

0 commit comments

Comments
 (0)