perf: add defer to scripts and lazy loading to images
Some checks failed
Some checks failed
Add defer attribute to 145 <script> tags across 103 template files (PERF-067) and loading="lazy" to 22 <img> tags across 13 template files (PERF-058). Both improve page load performance. Validator totals: 0 errors, 2 warnings, 1360 info (down from 1527). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
{% if show_avatar %}
|
||||
<div class="w-10 h-10 rounded-full overflow-hidden bg-purple-100 dark:bg-purple-900/30 flex items-center justify-center flex-shrink-0">
|
||||
<template x-if="{{ review_var }}.author_avatar">
|
||||
<img :src="{{ review_var }}.author_avatar" :alt="{{ review_var }}.author_name" class="w-full h-full object-cover">
|
||||
<img loading="lazy" :src="{{ review_var }}.author_avatar" :alt="{{ review_var }}.author_name" class="w-full h-full object-cover">
|
||||
</template>
|
||||
<template x-if="!{{ review_var }}.author_avatar">
|
||||
<span class="text-sm font-medium text-purple-600 dark:text-purple-400" x-text="{{ review_var }}.author_name?.charAt(0)?.toUpperCase()"></span>
|
||||
@@ -111,7 +111,7 @@
|
||||
type="button"
|
||||
class="w-16 h-16 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700 hover:border-purple-500 transition-colors"
|
||||
>
|
||||
<img :src="image" alt="Review image" class="w-full h-full object-cover">
|
||||
<img loading="lazy" :src="image" alt="Review image" class="w-full h-full object-cover">
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
@@ -353,7 +353,7 @@
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<template x-for="(image, index) in {{ images_model }} || []" :key="index">
|
||||
<div class="relative w-20 h-20 rounded-lg overflow-hidden group">
|
||||
<img :src="image" alt="Review image" class="w-full h-full object-cover">
|
||||
<img loading="lazy" :src="image" alt="Review image" class="w-full h-full object-cover">
|
||||
<button
|
||||
type="button"
|
||||
@click="{{ images_model }}.splice(index, 1)"
|
||||
|
||||
Reference in New Issue
Block a user