Skip to content

Commit a9b8432

Browse files
committed
Beautify the layout for posts heading and preview-image.
1 parent 4c3afe6 commit a9b8432

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

_layouts/post.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ <h1 data-toc-skip>{{ page.title }}</h1>
6161
</div> <!-- .post-meta -->
6262

6363
<div class="post-content">
64+
6465
{% if page.image %}
65-
<img src="{{ page.image }}">
66+
<img src="{{ page.image }}" class="post-preview-img">
6667
{% endif %}
68+
6769
<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
6870
{% if content contains '<img src=' %}
6971
{{ content | replace: '<img src=', '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src=' }}

assets/css/_addon/main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ a {
737737
.post {
738738
h1 {
739739
margin-top: 3rem;
740+
margin-bottom: 1rem;
740741
}
741742
em { /* MarkDown italic */
742743
padding-right: .2rem;

assets/css/post.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
5252
margin: 1rem 0 0.8rem;
5353
}
5454
}
55+
.post-preview-img {
56+
margin-top: 0;
57+
margin-bottom: 2.5rem;
58+
}
5559
}
5660

5761
.post-tail-wrapper {

0 commit comments

Comments
 (0)