astro-accelerator 5.9.16 → 5.9.17

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": "5.9.16",
2
+ "version": "5.9.17",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -33,11 +33,11 @@
33
33
  "dts": "tsc ./tests/locate-content.js ./tests/locate-navigation.js ./tests/locate-search.js --allowJs --declaration --emitDeclarationOnly"
34
34
  },
35
35
  "dependencies": {
36
- "@astrojs/mdx": "^4.3.0",
37
- "astro": "^5.11.0",
38
- "astro-accelerator-utils": "^0.3.48",
36
+ "@astrojs/mdx": "^4.3.3",
37
+ "astro": "^5.12.8",
38
+ "astro-accelerator-utils": "^0.3.49",
39
39
  "cspell": "^8.19.4",
40
- "csv": "^6.4.0",
40
+ "csv": "^6.4.1",
41
41
  "glob": "^11.0.3",
42
42
  "hast-util-from-selector": "^3.0.1",
43
43
  "html-to-text": "^9.0.5",
@@ -48,7 +48,7 @@
48
48
  "sharp": "^0.33.5"
49
49
  },
50
50
  "devDependencies": {
51
- "@playwright/test": "^1.54.0"
51
+ "@playwright/test": "^1.54.2"
52
52
  },
53
53
  "files": [
54
54
  ".npmrc",
@@ -79,6 +79,12 @@ export async function getData() {
79
79
  }
80
80
  });
81
81
  });
82
+
83
+ sourcePosts.filter(PostFiltering.isAuthor).forEach((p) => {
84
+ if (!data.authors.includes(p.frontmatter.id)) {
85
+ data.authors.push(p.frontmatter.id);
86
+ }
87
+ });
82
88
 
83
89
  return data;
84
90
  }
@@ -93,7 +99,7 @@ export async function getStaticPaths({ paginate }: any) {
93
99
  });
94
100
  return paginate(filtered, {
95
101
  params: { author: a.toLowerCase() },
96
- props: { pubDate: filtered[0].frontmatter.pubDate },
102
+ props: { pubDate: filtered[0]?.frontmatter.pubDate ?? new Date() },
97
103
  pageSize: SITE.pageSize
98
104
  });
99
105
  }).flat();
@@ -146,4 +152,4 @@ stats.stop();
146
152
  </div>
147
153
  <ArticleList lang={ lang } posts={ page.data } />
148
154
  <PagingLinks lang={ lang } page={ page } pageLinks={ pageLinks } />
149
- </Default>
155
+ </Default>
@@ -88,19 +88,22 @@ async function recurseFiles(directory) {
88
88
  if (!fs.existsSync(metaPath)) {
89
89
  console.log('Processing:', metaPath);
90
90
  filesToProcess.push(info);
91
+ } else {
92
+ const data = fs.readFileSync(metaPath, 'utf8');
93
+ const jsonData = JSON.parse(data);
94
+ const date90DaysAgo = new Date(
95
+ Date.now() - 90 * 24 * 60 * 60 * 1000
96
+ );
97
+
98
+ if (
99
+ !jsonData.updated ||
100
+ new Date(jsonData.updated) < date90DaysAgo
101
+ ) {
102
+ console.log('Processing:', metaPath);
103
+ filesToProcess.push(info);
104
+ }
91
105
  }
92
106
 
93
- // The code below uses modified dates (and will update more images than the above)
94
- // const fullPath = path.join(imageDirectory, info.path);
95
- // const modified = fs.statSync(fullPath).mtime;
96
-
97
- // const destinationModified = fs.existsSync(fullDestination)
98
- // ? fs.statSync(fullDestination).mtime
99
- // : new Date(0);
100
-
101
- // if (destinationModified < modified) {
102
- // filesToProcess.push(info);
103
- // }
104
107
  break;
105
108
  }
106
109
  }
@@ -141,6 +144,7 @@ for (const file of filesToProcess) {
141
144
  width: info.width,
142
145
  height: info.height,
143
146
  sizeInBytes: info.size,
147
+ updated: new Date().toISOString(),
144
148
  };
145
149
 
146
150
  const metaFile = source + '.json';