Skip to content

Commit

Permalink
Add loading=lazy conditionally
Browse files Browse the repository at this point in the history
Similarly to what we do with the videos.
  • Loading branch information
XhmikosR committed Jan 15, 2021
1 parent df659c6 commit d50e4ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/_includes/author-info.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{% assign author = post.author | default: page.author -%}
{% comment -%}
Accepts one param, "do_lazyload"
{%- endcomment-%}

{%- assign author = post.author | default: page.author -%}
{%- assign date = post.date | default: page.date -%}
<div class="d-flex align-items-center mb-4 text-muted author-info">
<a class="d-flex align-items-center text-muted text-decoration-none" href="https://github.com/{{ author }}" target="_blank" rel="noopener">
<img class="mb-0 mr-2" src="https://github.com/{{ author }}.png" alt="" width="32" height="32">
<img class="mb-0 mr-2" src="https://github.com/{{ author }}.png" alt="" width="32" height="32"{% if include.do_lazyload == true %} loading="lazy"{% endif %}>
<span>@{{ author }}</span>
</a>
<span class="d-flex align-items-center ml-3">
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="post-title fw-500">
</a>
</h1>

{%- include author-info.html -%}
{%- include author-info.html do_lazyload=lazyload -%}

{% if post.video %}
{%- include video.html do_lazyload=lazyload -%}
Expand Down

0 comments on commit d50e4ea

Please sign in to comment.