astro-accelerator 0.0.66 → 0.0.71
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 +1 -1
- package/src/pages/articles/feed.xml.ts +1 -1
- package/src/pages/authors/[author]/[page].astro +17 -5
- package/src/pages/search.json.ts +1 -1
- package/src/pages/sitemap.xml.ts +1 -1
- package/src/themes/accelerator/layouts/Default.astro +0 -2
- package/src/themes/accelerator/utilities/language.json +3 -0
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import { Accelerator, PostFiltering } from 'astro-accelerator-utils';
|
|
|
6
6
|
|
|
7
7
|
async function getData() {
|
|
8
8
|
//@ts-ignore
|
|
9
|
-
const allArticles = import.meta.glob('./**/*.md', './**/*.mdx');
|
|
9
|
+
const allArticles = import.meta.glob(['./**/*.md', './**/*.mdx']);
|
|
10
10
|
|
|
11
11
|
const accelerator = new Accelerator(SITE);
|
|
12
12
|
|
|
@@ -29,25 +29,26 @@ const author = accelerator.posts.all()
|
|
|
29
29
|
return accelerator.urlFormatter.getAuthorId(url) == slug;
|
|
30
30
|
})[0];
|
|
31
31
|
|
|
32
|
+
// Language
|
|
33
|
+
const _ = Lang(lang);
|
|
34
|
+
|
|
32
35
|
// Props
|
|
33
36
|
type Props = {
|
|
34
37
|
page: Page<MarkdownInstance>;
|
|
35
38
|
headings: { depth: number; slug: string; text: string; }[];
|
|
36
39
|
pubDate: Date;
|
|
37
40
|
};
|
|
38
|
-
const { page, headings, pubDate } = Astro.props satisfies Props;
|
|
41
|
+
const { title, page, headings, pubDate } = Astro.props satisfies Props;
|
|
39
42
|
|
|
40
43
|
const authorFrontmatter = {
|
|
41
44
|
...author.frontmatter,
|
|
45
|
+
titleAdditional: `(${ _(Translations.articles.author) }) ` + _(Translations.articles.page_title).replace('{n}', page.currentPage.toString()),
|
|
42
46
|
pubDate: pubDate
|
|
43
47
|
} as Frontmatter;
|
|
44
48
|
|
|
45
49
|
const text = (author.frontmatter.summary ?? '').replace('\n', '\n\n');
|
|
46
50
|
const authorText = accelerator.markdown.getHtmlFrom(text);
|
|
47
51
|
|
|
48
|
-
// Language
|
|
49
|
-
const _ = Lang(lang);
|
|
50
|
-
|
|
51
52
|
// Logic
|
|
52
53
|
type AuthorData = {
|
|
53
54
|
posts: MarkdownInstance[];
|
|
@@ -95,8 +96,19 @@ export async function getStaticPaths({ paginate }: any) {
|
|
|
95
96
|
|
|
96
97
|
// Page Links
|
|
97
98
|
const pageLinks = accelerator.paging.links(SITE.pageLinks, page.lastPage, page.currentPage, page.url.current);
|
|
99
|
+
|
|
100
|
+
// Breadcrumbs
|
|
101
|
+
const breadcrumbs: { url: string; title: string; ariaCurrent?: string; }[] = []
|
|
102
|
+
|
|
103
|
+
if (page.url.current != pageLinks[0].url) {
|
|
104
|
+
breadcrumbs.push({
|
|
105
|
+
url: page.url.current,
|
|
106
|
+
title: _(Translations.articles.page_title).replace('{n}', page.currentPage.toString()),
|
|
107
|
+
ariaCurrent: 'page',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
98
110
|
---
|
|
99
|
-
<Default frontmatter={ authorFrontmatter } headings={ headings }>
|
|
111
|
+
<Default frontmatter={ authorFrontmatter } headings={ headings } breadcrumbs={ breadcrumbs }>
|
|
100
112
|
<Fragment set:html={ authorText } />
|
|
101
113
|
<h2>{ _(Translations.articles.page_title).replace('{n}', page.currentPage.toString()) }</h2>
|
|
102
114
|
<ArticleList lang={ lang } posts={ page.data } />
|
package/src/pages/search.json.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { SITE } from '@config';
|
|
|
6
6
|
|
|
7
7
|
const getData = async () => {
|
|
8
8
|
//@ts-ignore
|
|
9
|
-
const allPages = import.meta.glob(['./**/*.md'
|
|
9
|
+
const allPages = import.meta.glob(['./**/*.md', './**/*.mdx']);
|
|
10
10
|
const items = [];
|
|
11
11
|
|
|
12
12
|
const accelerator = new Accelerator(SITE);
|
package/src/pages/sitemap.xml.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { PostFiltering, Accelerator } from 'astro-accelerator-utils';
|
|
|
6
6
|
|
|
7
7
|
async function getData() {
|
|
8
8
|
//@ts-ignore
|
|
9
|
-
const allPages = import.meta.glob('./**/*.md', './**/*.mdx');
|
|
9
|
+
const allPages = import.meta.glob(['./**/*.md', './**/*.mdx']);
|
|
10
10
|
|
|
11
11
|
const accelerator = new Accelerator(SITE);
|
|
12
12
|
let pages = [];
|