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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "7.1.23",
2
+ "version": "7.1.25",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -819,6 +819,7 @@ table {
819
819
  .author-page>img {
820
820
  align-self: self-start;
821
821
  width: 100%;
822
+ height: auto;
822
823
 
823
824
  @media (max-width: 860px) {
824
825
  display: block;
@@ -807,16 +807,19 @@ table {
807
807
  }
808
808
 
809
809
  .author-page {
810
- display: flex;
810
+ display: grid;
811
+ grid-template-columns: 1fr 2fr;
811
812
  gap: var(--grid-gap);
812
813
 
813
814
  @media (max-width: 860px) {
814
- flex-direction: column;
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;
@@ -61,7 +61,7 @@ export function getImageInfo(src, className, sizes) {
61
61
  }
62
62
 
63
63
  let uri = src;
64
- uri = uri.replace(/.jpg|.jpeg|.png|.webp/i, '.avif');
64
+ uri = uri.replace(/\.(jpg|jpeg|png|webp)$/i, '.avif');
65
65
 
66
66
  const imgFallback = getDestination(src, 'x');
67
67
 
@@ -32,8 +32,8 @@ function getDestinationFilePathless(source, s) {
32
32
  s.toString(),
33
33
  source
34
34
  );
35
- destination = destination.replace(path.parse(destination).ext, '');
36
- return destination;
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
- /.jpg$|.jpeg$|.png$|.webp$/,
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
- destination = destination.replace(path.parse(destination).ext, '');
38
- return destination;
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
- /.jpg$|.jpeg$|.png$|.webp$/i,
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: 90 })
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: 90 })
173
+ .avif({ quality: avifQuality })
173
174
  .toFile(resizeDestination + '.avif');
174
175
  }
175
176
  }
File without changes
File without changes