Skip to content

Commit

Permalink
update: decoding asyncを消し、loadingも最初に見える分はeagerに
Browse files Browse the repository at this point in the history
  • Loading branch information
yamadashy committed Jan 7, 2024
1 parent c293803 commit 6e15a02
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const imageShortcode = async (src, alt, pathPrefix = '') => {
} catch (e) {
// エラーが起きたら代替画像にする
console.log('[image-short-code] error', src);
return `<img src='${pathPrefix}images/alternate-feed-image.png' alt='${alt}' loading='lazy' decoding='async' width='256' height='256'>`
return `<img src='${pathPrefix}images/alternate-feed-image.png' alt='${alt}' loading='lazy' width='256' height='256'>`
}

return Image.generateHTML(metadata, {
Expand Down
4 changes: 2 additions & 2 deletions src/site/_includes/layouts/main.njk
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
<div class="ui-layout-container">
<div class="ui-section-header__layout ui-layout-flex">
<a href="{{ constants.siteUrl }}" role="link" aria-label="#">
<img src="{{ page.url | relativeUrl }}images/icon.png" alt='サイトロゴ' loading="lazy" decoding='async' width='96' height='96' />
<img src="{{ page.url | relativeUrl }}images/icon.png" alt='サイトロゴ' loading="eager" width='96' height='96' />
<span class='ui-section-header__title'>{{ constants.siteTitle }}</span>
</a>
<a href="{{ constants.gitHubRepositoryUrl }}" role="link" aria-label="#">
<img src='{{ page.url | relativeUrl }}images/github-mark.png' alt='GitHubロゴ' loading="lazy" decoding='async' width='96' height='96' />
<img src='{{ page.url | relativeUrl }}images/github-mark.png' alt='GitHubロゴ' loading="eager" width='96' height='96' />
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/site/_includes/layouts/partials/feed-item.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
{% if feedItem.image %}
{% image feedItem.image.url, '記事のアイキャッチ画像', page.url | relativeUrl %}
{% else %}
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" decoding='async' alt='記事のアイキャッチ画像' width='256' height='256'>
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" alt='記事のアイキャッチ画像' width='256' height='256'>
{% endif %}
</a>
<div class='ui-feed-item__content'>
<a class='ui-feed-item__title' href='{{ feedItem.url }}'>{{ feedItem._custom.originalTitle }}</a>
{% if feedItem._custom.hatenaCount > 0 %}
<div class='ui-feed-item__hatena-count' title='はてなブックマーク数'>
<img src='{{ page.url | relativeUrl }}images/hatenabookmark-icon.png' alt='はてなブックマークアイコン' loading="lazy" decoding='async' width='96' height='96'>
<img src='{{ page.url | relativeUrl }}images/hatenabookmark-icon.png' alt='はてなブックマークアイコン' loading="lazy" width='96' height='96'>
<span>{{ feedItem._custom.hatenaCount }}</span>
</div>
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions src/site/_includes/layouts/partials/top-section.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="ui-component-cta ui-layout-flex">
<form class="ui-component-form ui-layout-grid">
<label class='ui-component-form__label' for='feed-url-slack'>
<img src='{{ page.url | relativeUrl }}images/slack-mark.png' alt='Slackのロゴ' loading="lazy" decoding='async' width='96' height='96'>
<img src='{{ page.url | relativeUrl }}images/slack-mark.png' alt='Slackのロゴ' loading="eager" width='96' height='96'>
</label>
<input type='text' id='feed-url-slack' class="ui-component-input ui-component-input-medium" readonly value='/feed {{ constants.feedUrls.rss }}'>
<button type="button" class="ui-component-button ui-component-button-medium ui-component-button-primary feed-url-copy-button">コピー</button>
Expand All @@ -22,10 +22,10 @@
</form>
<div class='ui-top-section__subscribe'>
<a href='https://feedly.com/i/subscription/feed/{{ constants.feedUrls.rss }}' target="_blank" rel="noopener">
<img src='{{ page.url | relativeUrl }}images/subscribe-feedly.png' alt='follow us in feedly' width='152' height='56'>
<img src='{{ page.url | relativeUrl }}images/subscribe-feedly.png' loading="eager" alt='follow us in feedly' width='152' height='56'>
</a>
<a href="https://www.inoreader.com?add_feed={{ constants.feedUrls.rss }}" target="_blank" rel="noopener">
<img src="{{ page.url | relativeUrl }}images/subscribe-inoreader.png" alt="follow us in inoreader" width='260' height='72'>
<img src="{{ page.url | relativeUrl }}images/subscribe-inoreader.png" loading="eager" alt="follow us in inoreader" width='260' height='72'>
</a>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/site/blog-feed.njk
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ permalink: "blogs/{{ blogFeed.linkMd5Hash }}/"
{% if feedItem.ogImageUrl %}
{% image feedItem.ogImageUrl, '記事のアイキャッチ画像', page.url | relativeUrl %}
{% else %}
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" decoding='async' alt='記事のアイキャッチ画像' width='256' height='256'>
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" alt='記事のアイキャッチ画像' width='256' height='256'>
{% endif %}
</a>
<div class='ui-feed-item__content'>
<a class='ui-feed-item__title' href='{{ feedItem.link }}'>{{ feedItem.title }}</a>
{% if feedItem.hatenaCount > 0 %}
<div class='ui-feed-item__hatena-count' title='はてなブックマーク数'>
<img src='{{ page.url | relativeUrl }}images/hatenabookmark-icon.png' alt='はてなブックマークアイコン' loading="lazy" decoding='async' width='96' height='96'>
<img src='{{ page.url | relativeUrl }}images/hatenabookmark-icon.png' alt='はてなブックマークアイコン' loading="lazy" width='96' height='96'>
<span>{{ feedItem.hatenaCount }}</span>
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/site/blogs.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ eleventyComputed:
{% if blogFeed.ogImageUrl %}
{% image blogFeed.ogImageUrl, 'ブログのアイキャッチ画像', '../' %}
{% else %}
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" decoding='async' alt='記事のアイキャッチ画像' width='256' height='256'>
<img src='{{ page.url | relativeUrl }}images/alternate-feed-image.png' loading="lazy" alt='記事のアイキャッチ画像' width='256' height='256'>
{% endif %}
</a>
<div class='ui-blog__content'>
Expand Down

0 comments on commit 6e15a02

Please sign in to comment.