astro-accelerator 4.0.48 → 4.0.50
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": "4.0.
|
|
2
|
+
"version": "4.0.50",
|
|
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.14.
|
|
35
|
+
"astro": "^4.15.8",
|
|
36
|
+
"astro-accelerator-utils": "^0.3.20",
|
|
37
|
+
"cspell": "^8.14.4",
|
|
38
38
|
"csv": "^6.3.10",
|
|
39
39
|
"glob": "^11.0.0",
|
|
40
40
|
"hast-util-from-selector": "^3.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"sharp": "^0.33.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@playwright/test": "^1.
|
|
48
|
+
"@playwright/test": "^1.47.1"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
".npmrc",
|
|
@@ -18,6 +18,9 @@ stats.start();
|
|
|
18
18
|
|
|
19
19
|
const lang = SITE.default.lang;
|
|
20
20
|
|
|
21
|
+
// Language
|
|
22
|
+
const _ = Lang(lang);
|
|
23
|
+
|
|
21
24
|
// Props
|
|
22
25
|
type Props = {
|
|
23
26
|
page: Page<MarkdownInstance>;
|
|
@@ -26,17 +29,17 @@ type Props = {
|
|
|
26
29
|
};
|
|
27
30
|
const { page, headings, pubDate } = Astro.props satisfies Props;
|
|
28
31
|
|
|
32
|
+
// Enhance the title
|
|
33
|
+
const pageTitle = `${_(Translations.articles.articles_title)} - ${_(Translations.articles.page_title).replace('{n}', page.currentPage.toString())}`;
|
|
34
|
+
|
|
29
35
|
const frontmatter: Frontmatter = {
|
|
30
36
|
layout: 'src/layouts/Default.astro',
|
|
31
|
-
title:
|
|
37
|
+
title: pageTitle,
|
|
32
38
|
keywords: `articles`,
|
|
33
39
|
description: `${SITE.title} articles.`,
|
|
34
40
|
pubDate: pubDate
|
|
35
41
|
};
|
|
36
42
|
|
|
37
|
-
// Language
|
|
38
|
-
const _ = Lang(lang);
|
|
39
|
-
|
|
40
43
|
// Logic
|
|
41
44
|
export async function getData() {
|
|
42
45
|
const sourcePosts = await Astro.glob('./**/*.md*') as MarkdownInstance[];
|
|
@@ -61,7 +64,6 @@ const pageLinks = accelerator.paging.links(SITE.pageLinks, page.lastPage, page.c
|
|
|
61
64
|
stats.stop();
|
|
62
65
|
---
|
|
63
66
|
<Default frontmatter={ frontmatter } headings={ headings }>
|
|
64
|
-
<h2>{ _(Translations.articles.page_title).replace('{n}', page.currentPage.toString()) }</h2>
|
|
65
67
|
<ArticleList lang={ lang } posts={ page.data } />
|
|
66
68
|
<PagingLinks lang={ lang } page={ page } pageLinks={ pageLinks } />
|
|
67
69
|
</Default>
|
|
@@ -19,7 +19,7 @@ const { lang, count } = Astro.props satisfies Props;
|
|
|
19
19
|
const allPages = accelerator.posts.all();
|
|
20
20
|
const pageCount = allPages.length;
|
|
21
21
|
const pages = allPages
|
|
22
|
-
.filter(PostFiltering.
|
|
22
|
+
.filter(PostFiltering.hasDate)
|
|
23
23
|
.filter(PostFiltering.isListable)
|
|
24
24
|
.sort(PostOrdering.sortByModDateDesc)
|
|
25
25
|
.slice(0, Math.min(count, pageCount));
|
|
@@ -30,7 +30,7 @@ stats.stop();
|
|
|
30
30
|
{pages.map((post) => (
|
|
31
31
|
<li data-destination={ accelerator.urlFormatter.formatAddress(post.url) }>
|
|
32
32
|
<a href={ accelerator.urlFormatter.formatAddress(post.url) }>{ accelerator.markdown.getTextFrom(post.frontmatter.title) }</a>
|
|
33
|
-
<time datetime={ post.frontmatter.modDate.toString() }>
|
|
33
|
+
<time datetime={ (post.frontmatter.modDate || post.frontmatter.pubDate).toString() }>
|
|
34
34
|
{ accelerator.dateFormatter.formatDate(post.frontmatter.modDate, lang) }
|
|
35
35
|
</time>
|
|
36
36
|
</li>
|