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:
svemagie
2026-05-03 13:02:54 +02:00
parent 3abd62cd25
commit 6c7dd4a8b7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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",