astro-accelerator 7.1.23 → 7.1.25
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 +1 -1
- package/public/css/{main.7.1.19.css → main.7.1.24.css} +1 -0
- package/public/css/{main.7.1.18.css → main.7.1.25.css} +5 -2
- package/src/themes/accelerator/utilities/custom-markdown.mjs +1 -1
- package/src/themes/accelerator/utilities/dist-thinner.mjs +3 -3
- package/src/themes/accelerator/utilities/img.mjs +6 -5
- /package/public/css/{vars.7.1.18.css → vars.7.1.24.css} +0 -0
- /package/public/css/{vars.7.1.19.css → vars.7.1.25.css} +0 -0
package/package.json
CHANGED
|
@@ -807,16 +807,19 @@ table {
|
|
|
807
807
|
}
|
|
808
808
|
|
|
809
809
|
.author-page {
|
|
810
|
-
display:
|
|
810
|
+
display: grid;
|
|
811
|
+
grid-template-columns: 1fr 2fr;
|
|
811
812
|
gap: var(--grid-gap);
|
|
812
813
|
|
|
813
814
|
@media (max-width: 860px) {
|
|
814
|
-
|
|
815
|
+
display: block;
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
818
|
|
|
818
819
|
.author-page>img {
|
|
819
820
|
align-self: self-start;
|
|
821
|
+
width: 100%;
|
|
822
|
+
height: auto;
|
|
820
823
|
|
|
821
824
|
@media (max-width: 860px) {
|
|
822
825
|
display: block;
|
|
@@ -32,8 +32,8 @@ function getDestinationFilePathless(source, s) {
|
|
|
32
32
|
s.toString(),
|
|
33
33
|
source
|
|
34
34
|
);
|
|
35
|
-
|
|
36
|
-
return
|
|
35
|
+
const parsed = path.parse(destination);
|
|
36
|
+
return path.join(parsed.dir, parsed.name);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
async function recurseFiles(directory) {
|
|
@@ -57,7 +57,7 @@ async function recurseFiles(directory) {
|
|
|
57
57
|
const sourcePath = path.join(directory, file.name);
|
|
58
58
|
|
|
59
59
|
const avif = sourcePath.replace(
|
|
60
|
-
|
|
60
|
+
/\.(jpg|jpeg|png|webp)$/i,
|
|
61
61
|
'.avif'
|
|
62
62
|
);
|
|
63
63
|
const info = {
|
|
@@ -34,8 +34,8 @@ function getDestinationFilePathless(source, s) {
|
|
|
34
34
|
s.toString(),
|
|
35
35
|
source
|
|
36
36
|
);
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
const parsed = path.parse(destination);
|
|
38
|
+
return path.join(parsed.dir, parsed.name);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
async function createDestinationFolder(destinationFile) {
|
|
@@ -60,7 +60,7 @@ async function recurseFiles(directory) {
|
|
|
60
60
|
const sourcePath = path.join(directory, file.name);
|
|
61
61
|
|
|
62
62
|
const avif = sourcePath.replace(
|
|
63
|
-
|
|
63
|
+
/\.(jpg|jpeg|png|webp)$/i,
|
|
64
64
|
'.avif'
|
|
65
65
|
);
|
|
66
66
|
const info = {
|
|
@@ -159,17 +159,18 @@ for (const file of filesToProcess) {
|
|
|
159
159
|
await createDestinationFolder(resizeDestination);
|
|
160
160
|
|
|
161
161
|
const metadata = await sharp(source).metadata();
|
|
162
|
+
const avifQuality = 80;
|
|
162
163
|
|
|
163
164
|
if (metadata.width > size[key]) {
|
|
164
165
|
// Only resize if the image is larger than the target size
|
|
165
166
|
sharp(source)
|
|
166
167
|
.resize(size[key], null)
|
|
167
|
-
.avif({ quality:
|
|
168
|
+
.avif({ quality: avifQuality })
|
|
168
169
|
.toFile(resizeDestination + '.avif');
|
|
169
170
|
} else {
|
|
170
171
|
// Don't resize as it's smaller than target size
|
|
171
172
|
sharp(source)
|
|
172
|
-
.avif({ quality:
|
|
173
|
+
.avif({ quality: avifQuality })
|
|
173
174
|
.toFile(resizeDestination + '.avif');
|
|
174
175
|
}
|
|
175
176
|
}
|
|
File without changes
|
|
File without changes
|