astro-accelerator 7.1.27 → 7.1.29
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 +3 -11
- package/src/pages/rss.xml.ts +3 -14
- package/src/themes/accelerator/utilities/img.mjs +6 -5
- /package/public/css/{main.7.1.22.css → main.7.1.28.css} +0 -0
- /package/public/css/{main.7.1.23.css → main.7.1.29.css} +0 -0
- /package/public/css/{vars.7.1.22.css → vars.7.1.28.css} +0 -0
- /package/public/css/{vars.7.1.23.css → vars.7.1.29.css} +0 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "7.1.
|
|
2
|
+
"version": "7.1.29",
|
|
3
3
|
"author": "Steve Fenton",
|
|
4
4
|
"name": "astro-accelerator",
|
|
5
5
|
"description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
"themes"
|
|
9
9
|
],
|
|
10
10
|
"type": "module",
|
|
11
|
-
"packageManager": "pnpm@12.6.0",
|
|
12
11
|
"engines": {
|
|
13
12
|
"node": ">=24",
|
|
14
13
|
"pnpm": ">=10"
|
|
@@ -90,12 +89,5 @@
|
|
|
90
89
|
"public/icons/**/*",
|
|
91
90
|
"public/css/*",
|
|
92
91
|
"public/js/*"
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
"overrides": {
|
|
96
|
-
"postcss@<8.4.31": ">=8.4.31",
|
|
97
|
-
"vite@<=5.0.11": ">=5.0.12",
|
|
98
|
-
"zod@<=3.22.2": ">=3.22.3"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
92
|
+
]
|
|
93
|
+
}
|
package/src/pages/rss.xml.ts
CHANGED
|
@@ -22,18 +22,6 @@ function escapeXml(text: string): string {
|
|
|
22
22
|
.replace(/'/g, ''');
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function getAbsoluteImageUrl(src: unknown): string | undefined {
|
|
26
|
-
if (typeof src !== 'string' || src.length === 0) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
try {
|
|
31
|
-
return new URL(src, SITE.url).href;
|
|
32
|
-
} catch {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
25
|
async function getData() {
|
|
38
26
|
//@ts-ignore
|
|
39
27
|
const allArticles = import.meta.glob(['./**/*.md', './**/*.mdx']);
|
|
@@ -95,7 +83,6 @@ async function getData() {
|
|
|
95
83
|
.slice(0, limit)
|
|
96
84
|
.map(
|
|
97
85
|
(a) => {
|
|
98
|
-
const imageUrl = getAbsoluteImageUrl(a.frontmatter.bannerImage?.src);
|
|
99
86
|
return `
|
|
100
87
|
<entry>
|
|
101
88
|
<title>${escapeXml(a.frontmatter.title ?? '')}</title>
|
|
@@ -104,7 +91,9 @@ async function getData() {
|
|
|
104
91
|
<published>${a.frontmatter.pubDate}</published>
|
|
105
92
|
<updated>${a.frontmatter.modDate ?? a.frontmatter.pubDate}</updated>
|
|
106
93
|
<summary>${escapeXml(a.frontmatter.description ?? '')}</summary>
|
|
107
|
-
${
|
|
94
|
+
${a.frontmatter.bannerImage?.src
|
|
95
|
+
? `<link rel="enclosure" href="${SITE.url + a.frontmatter.bannerImage?.src}" type="image/*" />`
|
|
96
|
+
: ''}
|
|
108
97
|
<author>
|
|
109
98
|
<name>${escapeXml(getAuthorName(a.frontmatter))}</name>
|
|
110
99
|
</author>
|
|
@@ -9,6 +9,8 @@ import fs from 'fs';
|
|
|
9
9
|
import path from 'path';
|
|
10
10
|
import sharp from 'sharp';
|
|
11
11
|
|
|
12
|
+
const quality = 70;
|
|
13
|
+
|
|
12
14
|
const workingDirectory = process.cwd();
|
|
13
15
|
|
|
14
16
|
const imageSize = await import(
|
|
@@ -128,12 +130,12 @@ for (const file of filesToProcess) {
|
|
|
128
130
|
break;
|
|
129
131
|
case '.webp':
|
|
130
132
|
sharp(source)
|
|
131
|
-
.webp({ quality:
|
|
133
|
+
.webp({ quality: quality })
|
|
132
134
|
.toFile(destination + '.webp');
|
|
133
135
|
break;
|
|
134
136
|
case '.avif':
|
|
135
137
|
sharp(source)
|
|
136
|
-
.avif({ quality:
|
|
138
|
+
.avif({ quality: quality })
|
|
137
139
|
.toFile(destination + '.avif');
|
|
138
140
|
break;
|
|
139
141
|
}
|
|
@@ -159,18 +161,17 @@ for (const file of filesToProcess) {
|
|
|
159
161
|
await createDestinationFolder(resizeDestination);
|
|
160
162
|
|
|
161
163
|
const metadata = await sharp(source).metadata();
|
|
162
|
-
const avifQuality = 80;
|
|
163
164
|
|
|
164
165
|
if (metadata.width > size[key]) {
|
|
165
166
|
// Only resize if the image is larger than the target size
|
|
166
167
|
sharp(source)
|
|
167
168
|
.resize(size[key], null)
|
|
168
|
-
.avif({ quality:
|
|
169
|
+
.avif({ quality: quality })
|
|
169
170
|
.toFile(resizeDestination + '.avif');
|
|
170
171
|
} else {
|
|
171
172
|
// Don't resize as it's smaller than target size
|
|
172
173
|
sharp(source)
|
|
173
|
-
.avif({ quality:
|
|
174
|
+
.avif({ quality: quality })
|
|
174
175
|
.toFile(resizeDestination + '.avif');
|
|
175
176
|
}
|
|
176
177
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|