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 -->
|
</div> <!-- .post-meta -->
|
||||||
|
|
||||||
{% capture post_content %}
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{% if page.image %}
|
{% if page.image %}
|
||||||
<img src="{{ page.image }}">
|
<img src="{{ page.image }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ content }}
|
<!-- Add lozad class into image tags. see: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
|
||||||
|
{% if content contains '<img src=' %}
|
||||||
|
{{ content | replace: '<img src=', '<img class="lozad" src="/assets/img/commons/loading.png" data-src=' }}
|
||||||
|
{% else %}
|
||||||
|
{{ content }}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</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=' }}
|
|
||||||
{% else %}
|
|
||||||
{{ post_content }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="post-tail text-muted">
|
<div class="post-tail text-muted">
|
||||||
<!-- Tags -->
|
<!-- Tags -->
|
||||||
|
|
Loading…
Reference in a new issue