perf: incremental dev builds + fetchpriority on photo posts
- package.json: add --incremental to dev script (skip unchanged templates) - post.njk: first photo gets fetchpriority=high instead of loading=lazy (first photo is the LCP element on photo post pages)
This commit is contained in:
@@ -73,7 +73,7 @@ withBlogSidebar: true
|
||||
{% if photoUrl and photoUrl[0] != '/' and 'http' not in photoUrl %}
|
||||
{% set photoUrl = '/' + photoUrl %}
|
||||
{% endif %}
|
||||
<img src="{{ photoUrl }}" alt="{{ img.alt | default('Photo from: ' + title) }}" class="u-photo rounded-lg max-w-full" loading="lazy" eleventy:ignore>
|
||||
<img src="{{ photoUrl }}" alt="{{ img.alt | default('Photo from: ' + title) }}" class="u-photo rounded-lg max-w-full"{% if loop.first %} fetchpriority="high"{% else %} loading="lazy"{% endif %} eleventy:ignore>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
"scripts": {
|
||||
"build:og": "node lib/og-cli.js content ${OG_CACHE_DIR:-.cache/og} 'giersig.'",
|
||||
"build": "eleventy",
|
||||
"dev": "eleventy --serve --watch",
|
||||
"dev": "eleventy --serve --watch --incremental",
|
||||
"build:css": "postcss css/tailwind.css -o css/style.css",
|
||||
"check:upstream-widgets": "node scripts/check-upstream-widget-drift.mjs",
|
||||
"check:upstream-widgets:strict": "node scripts/check-upstream-widget-drift.mjs --strict",
|
||||
|
||||
Reference in New Issue
Block a user