astro-accelerator 5.9.8 → 5.9.9

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.8",
2
+ "version": "5.9.9",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@astrojs/mdx": "^4.3.0",
37
- "astro": "^5.10.1",
37
+ "astro": "^5.11.0",
38
38
  "astro-accelerator-utils": "^0.3.47",
39
39
  "cspell": "^8.19.4",
40
40
  "csv": "^6.3.11",
@@ -42,7 +42,7 @@
42
42
  "hast-util-from-selector": "^3.0.1",
43
43
  "html-to-text": "^9.0.5",
44
44
  "keyword-extractor": "^0.0.28",
45
- "linkinator": "^6.1.2",
45
+ "linkinator": "^6.1.4",
46
46
  "optional": "^0.1.4",
47
47
  "remark-directive": "^4.0.0",
48
48
  "sharp": "^0.33.5"
@@ -0,0 +1,50 @@
1
+ ---
2
+ import { Accelerator, PostOrdering } from 'astro-accelerator-utils';
3
+ import { SITE } from '@config';
4
+
5
+ // Logic
6
+ const accelerator = new Accelerator(SITE);
7
+
8
+ const allPages = accelerator.posts.all();
9
+ let futurePosts = allPages.filter(
10
+ (p) =>
11
+ p.frontmatter.pubDate != null &&
12
+ Date.parse(p.frontmatter.pubDate) > Date.now()
13
+ );
14
+ futurePosts = futurePosts.sort(PostOrdering.sortByPubDate);
15
+
16
+ const pageCount = futurePosts.length;
17
+ const pages = futurePosts.slice(0, Math.min(50, pageCount));
18
+ ---
19
+
20
+ <!doctype html>
21
+ <html>
22
+ <head>
23
+ <meta charset="utf-8" />
24
+ <title>Publishing calendar</title>
25
+ <link rel="stylesheet" href="/css/report.css" />
26
+ </head>
27
+ <body>
28
+ <h2>Report: Publishing calendar</h2>
29
+ <table>
30
+ <thead>
31
+ <tr>
32
+ <th>Title</th>
33
+ <th>Publishing on</th>
34
+ </tr>
35
+ </thead>
36
+ {
37
+ pages.map((p) => (
38
+ <tr>
39
+ <td>
40
+ <a href={accelerator.urlFormatter.formatAddress(p.url)}>
41
+ {p.frontmatter.title}
42
+ </a>
43
+ </td>
44
+ <td>{p.frontmatter.pubDate}</td>
45
+ </tr>
46
+ ))
47
+ }
48
+ </table>
49
+ </body>
50
+ </html>