astro-accelerator 6.0.13 → 6.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "6.0.
|
|
2
|
+
"version": "6.0.15",
|
|
3
3
|
"author": "Steve Fenton",
|
|
4
4
|
"name": "astro-accelerator",
|
|
5
5
|
"description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
|
|
@@ -94,4 +94,4 @@
|
|
|
94
94
|
"zod@<=3.22.2": ">=3.22.3"
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
}
|
|
97
|
+
}
|
package/public/css/main.css
CHANGED
package/public/js/search.js
CHANGED
|
@@ -60,6 +60,7 @@ function unique(value, index, array) {
|
|
|
60
60
|
tags: string[];
|
|
61
61
|
url: string;
|
|
62
62
|
date: string;
|
|
63
|
+
bannerImage: { src: string; alt: string } | null;
|
|
63
64
|
matchedHeadings: Heading[];
|
|
64
65
|
}
|
|
65
66
|
} SearchEntry
|
|
@@ -375,9 +376,22 @@ function initializeSearch() {
|
|
|
375
376
|
li.dataset.score = (
|
|
376
377
|
Math.round((needle.score / total) * 1000) / 1000
|
|
377
378
|
).toString();
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
const resultContent = document.createElement('div');
|
|
380
|
+
resultContent.className = 'result-content';
|
|
381
|
+
resultContent.appendChild(path);
|
|
382
|
+
resultContent.appendChild(listElementTitle);
|
|
383
|
+
resultContent.appendChild(listElementDescription);
|
|
384
|
+
|
|
385
|
+
if (needle.bannerImage) {
|
|
386
|
+
const resultImage = document.createElement('img');
|
|
387
|
+
resultImage.src = needle.bannerImage.src;
|
|
388
|
+
resultImage.alt = needle.bannerImage.alt;
|
|
389
|
+
resultImage.className = 'result-image';
|
|
390
|
+
resultImage.loading = 'lazy';
|
|
391
|
+
listElementWrapper.appendChild(resultImage);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
listElementWrapper.appendChild(resultContent);
|
|
381
395
|
li.appendChild(listElementWrapper);
|
|
382
396
|
|
|
383
397
|
if (
|
package/src/pages/search.json.ts
CHANGED
|
@@ -117,7 +117,25 @@ const accelerator = new Accelerator(SITE);
|
|
|
117
117
|
|
|
118
118
|
.site-search-results-item a {
|
|
119
119
|
text-decoration: none;
|
|
120
|
-
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.site-search-results-item > a {
|
|
123
|
+
align-items: flex-start;
|
|
124
|
+
display: flex;
|
|
125
|
+
gap: 1.5rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.result-image {
|
|
129
|
+
width: 120px;
|
|
130
|
+
height: 120px;
|
|
131
|
+
object-fit: cover;
|
|
132
|
+
border-radius: var(--block-radius);
|
|
133
|
+
flex-shrink: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.result-content {
|
|
137
|
+
flex: 1;
|
|
138
|
+
min-width: 0;
|
|
121
139
|
}
|
|
122
140
|
|
|
123
141
|
.site-search-results .show-more {
|
|
@@ -210,6 +228,17 @@ const accelerator = new Accelerator(SITE);
|
|
|
210
228
|
width: unset;
|
|
211
229
|
}
|
|
212
230
|
|
|
231
|
+
.result-wrapper {
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
gap: 1rem;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.result-image {
|
|
237
|
+
width: 100%;
|
|
238
|
+
height: auto;
|
|
239
|
+
max-height: 200px;
|
|
240
|
+
}
|
|
241
|
+
|
|
213
242
|
.site-search-wrapper button {
|
|
214
243
|
width: 100%;
|
|
215
244
|
}
|