astro-accelerator 6.1.1 → 6.1.2

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": "6.1.1",
2
+ "version": "6.1.2",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -53,7 +53,7 @@
53
53
  "linkinator": "^7.6.1"
54
54
  },
55
55
  "files": [
56
- ".npmrc",
56
+ "pnpm-workspace.yaml",
57
57
  "env.d.ts",
58
58
  "tsconfig.json",
59
59
  "astro.config.mjs",
@@ -0,0 +1,7 @@
1
+ shamefullyHoist: true
2
+ ignoreScripts: true
3
+ minimumReleaseAge: 10080
4
+ minimumReleaseAgeExclude:
5
+ - astro-accelerator-utils
6
+ trustPolicy: no-downgrade
7
+ blockExoticSubdeps: true
@@ -5,7 +5,7 @@ title: Search
5
5
  navSearch: false
6
6
  navSitemap: false
7
7
  navMenu: false
8
- pubDate: 2022-09-17
8
+ pubDate: 2026-04-26
9
9
  keywords: about,astro,accelerator
10
10
  description: Astro Accelerator is an opinionated Astro site.
11
11
  robots: noindex, follow
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { PostOrdering, PostFiltering, Accelerator } from 'astro-accelerator-utils';
5
5
  import { SITE } from '@config';
6
+ import ArticleList from '@components/ArticleList.astro';
6
7
 
7
8
  const accelerator = new Accelerator(SITE);
8
9
  const stats = new accelerator.statistics('accelerator/components/RecentlyUpdated.astro');
@@ -10,29 +11,28 @@ stats.start();
10
11
 
11
12
  // Properties
12
13
  type Props = {
13
- lang: string;
14
+ lang?: string;
14
15
  count: number;
16
+ path?: string;
15
17
  };
16
- const { lang, count } = Astro.props satisfies Props;
18
+ const { lang = SITE.default.lang, count, path } = Astro.props satisfies Props;
17
19
 
18
20
  // Logic
19
21
  const allPages = accelerator.posts.all();
20
- const pageCount = allPages.length;
22
+ const normalizedPath = path
23
+ ? `/${path.replace(/^\/+/, '').replace(/\/+$/, '')}`
24
+ : null;
21
25
  const pages = allPages
22
26
  .filter(PostFiltering.hasDate)
23
27
  .filter(PostFiltering.isListable)
28
+ .filter((post) => {
29
+ if (!normalizedPath) return true;
30
+ const postUrl = post.url || '';
31
+ return postUrl === normalizedPath || postUrl.startsWith(`${normalizedPath}/`);
32
+ })
24
33
  .sort(PostOrdering.sortByModDateDesc)
25
- .slice(0, Math.min(count, pageCount));
34
+ .slice(0, count);
26
35
 
27
36
  stats.stop();
28
37
  ---
29
- <ul class="recent-updates">
30
- {pages.map((post) => (
31
- <li data-destination={ accelerator.urlFormatter.formatAddress(post.url) }>
32
- <a href={ accelerator.urlFormatter.formatAddress(post.url) }>{ accelerator.markdown.getTextFrom(post.frontmatter?.title) }</a>
33
- <time datetime={ (post.frontmatter.modDate || post.frontmatter.pubDate).toString() }>
34
- { accelerator.dateFormatter.formatDate((post.frontmatter.modDate || post.frontmatter.pubDate), lang) }
35
- </time>
36
- </li>
37
- ))}
38
- </ul>
38
+ <ArticleList lang={lang} posts={pages} />