astro-accelerator 4.0.29 → 4.0.34
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 +6 -5
- package/public/css/report.css +66 -0
- package/src/env.d.ts +4 -0
- package/src/pages/authors/[author]/[page].astro +29 -1
- package/src/pages/report/missing-banner.astro +1 -0
- package/src/pages/report/missing-meta.astro +1 -0
- package/src/pages/report/missing-pubdate.astro +1 -0
- package/src/pages/report/oldest-content/[page].astro +97 -0
- package/src/pages/report/oldest-content/index.astro +11 -0
- package/src/pages/report/taxonomy.astro +1 -0
- package/.npmrc +0 -2
- package/src/pages/report/oldest-content.astro +0 -46
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.0.
|
|
2
|
+
"version": "4.0.34",
|
|
3
3
|
"author": "Steve Fenton",
|
|
4
4
|
"name": "astro-accelerator",
|
|
5
5
|
"description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@astrojs/mdx": "^2.3.1",
|
|
35
|
-
"astro": "^4.
|
|
36
|
-
"astro-accelerator-utils": "^0.3.
|
|
37
|
-
"cspell": "^8.
|
|
35
|
+
"astro": "^4.11.5",
|
|
36
|
+
"astro-accelerator-utils": "^0.3.9",
|
|
37
|
+
"cspell": "^8.11.0",
|
|
38
38
|
"csv": "^6.3.9",
|
|
39
39
|
"hast-util-from-selector": "^3.0.0",
|
|
40
40
|
"html-to-text": "^9.0.5",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"sharp": "^0.33.4"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@playwright/test": "^1.
|
|
47
|
+
"@playwright/test": "^1.45.2"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
".npmrc",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"src/pages/search.json.ts",
|
|
67
67
|
"src/pages/sitemap.xml.ts",
|
|
68
68
|
"src/pages/report/*",
|
|
69
|
+
"src/pages/report/oldest-content/*",
|
|
69
70
|
"src/layouts/*",
|
|
70
71
|
"src/themes/accelerator/components/*",
|
|
71
72
|
"src/themes/accelerator/layouts/*",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--pop: #2d4295;
|
|
5
|
+
|
|
6
|
+
--color-header-bg: var(--pop);
|
|
7
|
+
--color-header-fg: #fff;
|
|
8
|
+
--color-row-border: #ddd;
|
|
9
|
+
--color-table-border: var(--pop);
|
|
10
|
+
--color-row-bg: #f9f9f9;
|
|
11
|
+
--color-row-bg-alt: #f3f3f3;
|
|
12
|
+
--color-row-bg-focus: #e5e5e5;
|
|
13
|
+
|
|
14
|
+
--block-radius: 0.3rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body {
|
|
18
|
+
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
19
|
+
padding: 2em;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
table {
|
|
23
|
+
border-collapse: collapse;
|
|
24
|
+
margin: 25px 0;
|
|
25
|
+
font-size: 0.9em;
|
|
26
|
+
font-family: sans-serif;
|
|
27
|
+
min-width: 400px;
|
|
28
|
+
box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
thead tr {
|
|
32
|
+
background-color: var(--color-header-bg);
|
|
33
|
+
color: var(--color-header-fg);
|
|
34
|
+
text-align: left;
|
|
35
|
+
border-radius: var(--block-radius) var(--block-radius) 0 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
table th:first-child {
|
|
39
|
+
border-radius: var(--block-radius) 0 0 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
table th:last-child {
|
|
43
|
+
border-radius: 0 var(--block-radius) 0 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
th,
|
|
47
|
+
td {
|
|
48
|
+
padding: 12px 15px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
tbody tr {
|
|
52
|
+
background-color: var(--color-row-bg);
|
|
53
|
+
border-bottom: 1px solid var(--color-row-border);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
tbody tr:nth-of-type(even) {
|
|
57
|
+
background-color: var(--color-row-bg-alt);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
tbody tr:last-of-type {
|
|
61
|
+
border-bottom: 2px solid var(--color-table-border);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
tbody tr:hover {
|
|
65
|
+
background-color: var(--color-row-bg-focus);
|
|
66
|
+
}
|
package/src/env.d.ts
ADDED
|
@@ -11,6 +11,7 @@ import { SITE } from '@config';
|
|
|
11
11
|
import Default from 'src/layouts/Default.astro';
|
|
12
12
|
import ArticleList from '@components/ArticleList.astro';
|
|
13
13
|
import PagingLinks from '@components/PagingLinks.astro';
|
|
14
|
+
import { getImageInfo } from '@util/custom-markdown.mjs';
|
|
14
15
|
|
|
15
16
|
const accelerator = new Accelerator(SITE);
|
|
16
17
|
const stats = new accelerator.statistics('pages/authors/[author]/[page].astro');
|
|
@@ -96,6 +97,11 @@ export async function getStaticPaths({ paginate }: any) {
|
|
|
96
97
|
}).flat();
|
|
97
98
|
}
|
|
98
99
|
|
|
100
|
+
// Get image info
|
|
101
|
+
const authorImage = author.frontmatter.bannerImage?.src
|
|
102
|
+
? getImageInfo(author.frontmatter.bannerImage.src, 'author-image', SITE.images.authorSize)
|
|
103
|
+
: null;
|
|
104
|
+
|
|
99
105
|
// Page Links
|
|
100
106
|
const pageLinks = accelerator.paging.links(SITE.pageLinks, page.lastPage, page.currentPage, page.url.current);
|
|
101
107
|
|
|
@@ -113,7 +119,29 @@ if (page.url.current != pageLinks[0].url) {
|
|
|
113
119
|
stats.stop();
|
|
114
120
|
---
|
|
115
121
|
<Default frontmatter={ authorFrontmatter } headings={ headings } breadcrumbs={ breadcrumbs }>
|
|
116
|
-
<
|
|
122
|
+
<div class="author-page">
|
|
123
|
+
{authorImage &&
|
|
124
|
+
<img
|
|
125
|
+
srcset={ authorImage.srcset }
|
|
126
|
+
sizes={ authorImage.sizes }
|
|
127
|
+
src={ authorImage.src }
|
|
128
|
+
alt={ author.frontmatter.bannerImage?.alt }
|
|
129
|
+
class={ authorImage.class }
|
|
130
|
+
width={ authorImage.metadata?.width }
|
|
131
|
+
height={ authorImage.metadata?.height }
|
|
132
|
+
/>
|
|
133
|
+
}
|
|
134
|
+
<div class="author-info">
|
|
135
|
+
<Fragment set:html={ authorText } />
|
|
136
|
+
{author.frontmatter.links &&
|
|
137
|
+
<ul>
|
|
138
|
+
{author.frontmatter.links.map((link) => (
|
|
139
|
+
<li><a href={ link.url } rel={ link.rel }><Fragment set:html={ link.text } /></a></li>
|
|
140
|
+
))}
|
|
141
|
+
</ul>
|
|
142
|
+
}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
117
145
|
<h2>{ _(Translations.articles.page_title).replace('{n}', page.currentPage.toString()) }</h2>
|
|
118
146
|
<ArticleList lang={ lang } posts={ page.data } />
|
|
119
147
|
<PagingLinks lang={ lang } page={ page } pageLinks={ pageLinks } />
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
import {
|
|
3
|
+
PostOrdering,
|
|
4
|
+
PostFiltering,
|
|
5
|
+
Accelerator,
|
|
6
|
+
} from 'astro-accelerator-utils';
|
|
7
|
+
import type { MarkdownInstance } from 'astro-accelerator-utils/types/Astro';
|
|
8
|
+
import type { Page } from 'astro';
|
|
9
|
+
import { SITE } from '@config';
|
|
10
|
+
import PagingLinks from '@components/PagingLinks.astro';
|
|
11
|
+
|
|
12
|
+
// Props
|
|
13
|
+
type Props = {
|
|
14
|
+
title: string;
|
|
15
|
+
page: Page<MarkdownInstance>;
|
|
16
|
+
headings: { depth: number; slug: string; text: string }[];
|
|
17
|
+
pubDate: Date;
|
|
18
|
+
};
|
|
19
|
+
const { page } = Astro.props satisfies Props;
|
|
20
|
+
const lang = SITE.default.lang;
|
|
21
|
+
|
|
22
|
+
// Logic
|
|
23
|
+
const accelerator = new Accelerator(SITE);
|
|
24
|
+
const stats = new accelerator.statistics(
|
|
25
|
+
'report/oldest-content/[page].astro'
|
|
26
|
+
);
|
|
27
|
+
stats.start();
|
|
28
|
+
|
|
29
|
+
export async function getData() {
|
|
30
|
+
const accelerator = new Accelerator(SITE);
|
|
31
|
+
const allPages = accelerator.posts.all();
|
|
32
|
+
const pageCount = allPages.length;
|
|
33
|
+
const pages = allPages
|
|
34
|
+
.filter(PostFiltering.isListable)
|
|
35
|
+
.sort(PostOrdering.sortByModDate);
|
|
36
|
+
|
|
37
|
+
return pages;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function getStaticPaths({ paginate }: any) {
|
|
41
|
+
let data = await getData();
|
|
42
|
+
|
|
43
|
+
return paginate(data, {
|
|
44
|
+
pageSize: 50,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Page Links
|
|
49
|
+
const pageLinks = accelerator.paging.links(
|
|
50
|
+
SITE.pageLinks,
|
|
51
|
+
page.lastPage,
|
|
52
|
+
page.currentPage,
|
|
53
|
+
page.url.current
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
stats.stop();
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
<!doctype html>
|
|
60
|
+
<html>
|
|
61
|
+
<head>
|
|
62
|
+
<meta charset="utf-8" />
|
|
63
|
+
<title>Oldest content</title>
|
|
64
|
+
<link rel="stylesheet" href="/css/report.css" />
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<h2>Report: Oldest content (Page <Fragment content={page.currentPage} />)</h2>
|
|
68
|
+
<table>
|
|
69
|
+
<thead>
|
|
70
|
+
<tr>
|
|
71
|
+
<th>Title</th>
|
|
72
|
+
<th>Published</th>
|
|
73
|
+
<th>Modified</th>
|
|
74
|
+
</tr>
|
|
75
|
+
</thead>
|
|
76
|
+
{
|
|
77
|
+
page.data.map((p) => (
|
|
78
|
+
<tr>
|
|
79
|
+
<td>
|
|
80
|
+
{PostFiltering.isListable(p) && (
|
|
81
|
+
<a href={accelerator.urlFormatter.formatAddress(p.url)}>
|
|
82
|
+
{p.frontmatter.title}
|
|
83
|
+
</a>
|
|
84
|
+
)}
|
|
85
|
+
{PostFiltering.isListable(p) == false && (
|
|
86
|
+
<span>{p.frontmatter.title}</span>
|
|
87
|
+
)}
|
|
88
|
+
</td>
|
|
89
|
+
<td>{p.frontmatter.pubDate}</td>
|
|
90
|
+
<td>{p.frontmatter.modDate}</td>
|
|
91
|
+
</tr>
|
|
92
|
+
))
|
|
93
|
+
}
|
|
94
|
+
</table>
|
|
95
|
+
<PagingLinks lang={lang} page={page} pageLinks={pageLinks} />
|
|
96
|
+
</body>
|
|
97
|
+
</html>
|
package/.npmrc
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
// warning: This file is overwritten by Astro Accelerator
|
|
3
|
-
|
|
4
|
-
import { PostOrdering, PostFiltering, Accelerator } from 'astro-accelerator-utils';
|
|
5
|
-
import { SITE } from '@config';
|
|
6
|
-
|
|
7
|
-
// Logic
|
|
8
|
-
const accelerator = new Accelerator(SITE);
|
|
9
|
-
|
|
10
|
-
const allPages = accelerator.posts.all();
|
|
11
|
-
const pageCount = allPages.length;
|
|
12
|
-
const pages = allPages.filter(PostFiltering.isListable).sort(PostOrdering.sortByModDate).slice(0, Math.min(50, pageCount));
|
|
13
|
-
---
|
|
14
|
-
<!doctype html>
|
|
15
|
-
<html>
|
|
16
|
-
<head>
|
|
17
|
-
<meta charset="utf-8" />
|
|
18
|
-
<title>Oldest content</title>
|
|
19
|
-
</head>
|
|
20
|
-
<body>
|
|
21
|
-
<h2>Report: Oldest content</h2>
|
|
22
|
-
<table>
|
|
23
|
-
<thead>
|
|
24
|
-
<tr>
|
|
25
|
-
<th>Title</th>
|
|
26
|
-
<th>Published</th>
|
|
27
|
-
<th>Modified</th>
|
|
28
|
-
</tr>
|
|
29
|
-
</thead>
|
|
30
|
-
{pages.map(p =>
|
|
31
|
-
<tr>
|
|
32
|
-
<td>
|
|
33
|
-
{PostFiltering.isListable(p) && (
|
|
34
|
-
<a href={ accelerator.urlFormatter.formatAddress(p.url) }>{ p.frontmatter.title }</a>
|
|
35
|
-
)}
|
|
36
|
-
{PostFiltering.isListable(p) == false && (
|
|
37
|
-
<span>{ p.frontmatter.title }</span>
|
|
38
|
-
)}
|
|
39
|
-
</td>
|
|
40
|
-
<td>{ p.frontmatter.pubDate }</td>
|
|
41
|
-
<td>{ p.frontmatter.modDate }</td>
|
|
42
|
-
</tr>
|
|
43
|
-
)}
|
|
44
|
-
</table>
|
|
45
|
-
</body>
|
|
46
|
-
</html>
|