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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.66",
2
+ "version": "0.0.71",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -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 } />
@@ -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'), './**/*.mdx')]);
9
+ const allPages = import.meta.glob(['./**/*.md', './**/*.mdx']);
10
10
  const items = [];
11
11
 
12
12
  const accelerator = new Accelerator(SITE);
@@ -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 = [];
@@ -22,8 +22,6 @@ type Props = {
22
22
  }
23
23
  const { frontmatter, headings, breadcrumbs } = Astro.props satisfies Props;
24
24
 
25
- console.log(headings);
26
-
27
25
  const lang = frontmatter.lang ?? SITE.default.lang;
28
26
  const textDirection = frontmatter.dir ?? SITE.default.dir;
29
27
 
@@ -109,6 +109,9 @@
109
109
  "tag": {
110
110
  "_note": "This must match your URL path to tag pages, as in /tag/example/1/",
111
111
  "en": "tag"
112
+ },
113
+ "author": {
114
+ "en": "author"
112
115
  }
113
116
  }
114
117
  }