Skip to content

Commit

Permalink
Beautify the layout for posts heading and preview-image.
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Aug 21, 2020
1 parent e2930fa commit 26921df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</div> <!-- .post-meta -->

<div class="post-content">

{% if page.image %}
<img src="{{ page.image }}">
<img src="{{ page.image }}" class="post-preview-img">
{% endif %}

<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
{% if content contains '<img src=' %}
{{ content | replace: '<img src=', '<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src=' }}
Expand Down
1 change: 1 addition & 0 deletions assets/css/_addon/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ a {
.post {
h1 {
margin-top: 3rem;
margin-bottom: 1rem;
}
em { /* MarkDown italic */
padding-right: .2rem;
Expand Down
4 changes: 4 additions & 0 deletions assets/css/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
margin: 1rem 0 0.8rem;
}
}
.post-preview-img {
margin-top: 0;
margin-bottom: 2.5rem;
}
}

.post-tail-wrapper {
Expand Down

0 comments on commit 26921df

Please sign in to comment.