Optimized the Post layout.
This commit is contained in:
parent
fc3a19c4d6
commit
a71bc50a5c
1 changed files with 6 additions and 10 deletions
|
@ -45,21 +45,17 @@ layout: default
|
|||
|
||||
</div> <!-- .post-meta -->
|
||||
|
||||
{% capture post_content %}
|
||||
<div class="post-content">
|
||||
{% if page.image %}
|
||||
<img src="{{ page.image }}">
|
||||
{% endif %}
|
||||
{{ content }}
|
||||
</div>
|
||||
{% endcapture %}
|
||||
|
||||
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||
{% if post_content contains '<img src=' %}
|
||||
{{ post_content | replace: '<img src=', '<img class="lozad" src="/assets/img/commons/loading.png" data-src=' }}
|
||||
{% if content contains '<img src=' %}
|
||||
{{ content | replace: '<img src=', '<img class="lozad" src="/assets/img/commons/loading.png" data-src=' }}
|
||||
{% else %}
|
||||
{{ post_content }}
|
||||
{{ content }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="post-tail text-muted">
|
||||
<!-- Tags -->
|
||||
|
|
Loading…
Reference in a new issue