astro-accelerator 5.10.41 → 5.10.43

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": "5.10.41",
2
+ "version": "5.10.43",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  // warning: This file is overwritten by Astro Accelerator
3
3
 
4
- import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter';
5
- import Author from '@layouts/Author.astro';
4
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
5
+ import AuthorLayout from "@layouts/Author.astro";
6
6
 
7
7
  // Properties
8
8
  type Props = {
9
- frontmatter: Frontmatter
10
- headings: { depth: number; slug: string; text: string; }[];
11
- }
9
+ frontmatter: Frontmatter;
10
+ headings: { depth: number; slug: string; text: string }[];
11
+ };
12
12
  const { frontmatter, headings } = Astro.props satisfies Props;
13
-
14
13
  ---
15
- <Author frontmatter={ frontmatter } headings={ headings }>
14
+
15
+ <AuthorLayout frontmatter={frontmatter} headings={headings}>
16
16
  <slot />
17
- </Author>
17
+ </AuthorLayout>
@@ -1,17 +1,21 @@
1
1
  ---
2
2
  // warning: This file is overwritten by Astro Accelerator
3
3
 
4
- import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter';
5
- import Default from '@layouts/Default.astro';
4
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
5
+ import DefaultLayout from "@layouts/Default.astro";
6
6
 
7
7
  // Properties
8
8
  type Props = {
9
- frontmatter: Frontmatter
10
- headings: { depth: number; slug: string; text: string; }[];
11
- breadcrumbs?: { url: string; title: string; ariaCurrent?: string; }[] | null;
12
- }
9
+ frontmatter: Frontmatter;
10
+ headings: { depth: number; slug: string; text: string }[];
11
+ breadcrumbs?: { url: string; title: string; ariaCurrent?: string }[] | null;
12
+ };
13
13
  const { frontmatter, headings, breadcrumbs } = Astro.props satisfies Props;
14
14
  ---
15
- <Default frontmatter={ frontmatter } headings={ headings } breadcrumbs={ breadcrumbs }>
15
+
16
+ <DefaultLayout
17
+ frontmatter={frontmatter}
18
+ headings={headings}
19
+ breadcrumbs={breadcrumbs}>
16
20
  <slot />
17
- </Default>
21
+ </DefaultLayout>
@@ -0,0 +1,21 @@
1
+ ---
2
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
3
+ import { SITE } from "@config";
4
+ import { Lang } from "@util/Languages";
5
+ import EventsLayout from "@layouts/Events.astro";
6
+
7
+ // Properties
8
+ type Props = {
9
+ frontmatter: Frontmatter;
10
+ headings: { depth: number; slug: string; text: string }[];
11
+ };
12
+ const { frontmatter, headings } = Astro.props satisfies Props;
13
+ const lang = frontmatter.lang ?? SITE.default.lang;
14
+
15
+ // Language
16
+ const _ = Lang(lang);
17
+ ---
18
+
19
+ <EventsLayout frontmatter={frontmatter} headings={headings}>
20
+ <slot />
21
+ </EventsLayout>
@@ -1,16 +1,17 @@
1
1
  ---
2
2
  // warning: This file is overwritten by Astro Accelerator
3
3
 
4
- import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter';
5
- import Redirect from '@layouts/Redirect.astro';
4
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
5
+ import RedirectLayout from "@layouts/Redirect.astro";
6
6
 
7
7
  // Properties
8
8
  type Props = {
9
- frontmatter: Frontmatter
10
- headings: { depth: number; slug: string; text: string; }[];
11
- }
9
+ frontmatter: Frontmatter;
10
+ headings: { depth: number; slug: string; text: string }[];
11
+ };
12
12
  const { frontmatter, headings } = Astro.props satisfies Props;
13
13
  ---
14
- <Redirect frontmatter={ frontmatter } headings={ headings }>
14
+
15
+ <RedirectLayout frontmatter={frontmatter} headings={headings}>
15
16
  <slot />
16
- </Redirect>
17
+ </RedirectLayout>
@@ -1,22 +1,23 @@
1
1
  ---
2
- import type { Frontmatter } from 'astro-accelerator-utils/types/Frontmatter';
3
- import { SITE } from '@config';
4
- import { Lang } from '@util/Languages';
5
- import Default from './Default.astro';
6
- import Search from '../themes/accelerator/components/Search.astro';
2
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
3
+ import { SITE } from "@config";
4
+ import { Lang } from "@util/Languages";
5
+ import DefaultLayout from "./Default.astro";
6
+ import SearchComponent from "../themes/accelerator/components/Search.astro";
7
7
 
8
8
  // Properties
9
9
  type Props = {
10
- frontmatter: Frontmatter
11
- headings: { depth: number; slug: string; text: string; }[];
12
- }
10
+ frontmatter: Frontmatter;
11
+ headings: { depth: number; slug: string; text: string }[];
12
+ };
13
13
  const { frontmatter, headings } = Astro.props satisfies Props;
14
14
  const lang = frontmatter.lang ?? SITE.default.lang;
15
15
 
16
16
  // Language
17
17
  const _ = Lang(lang);
18
18
  ---
19
- <Default frontmatter={ frontmatter } headings={ headings }>
19
+
20
+ <DefaultLayout frontmatter={frontmatter} headings={headings}>
20
21
  <slot />
21
- <Search lang={ lang }/>
22
- </Default>
22
+ <SearchComponent lang={lang} showSearch={true} />
23
+ </DefaultLayout>
@@ -51,7 +51,7 @@ const displayDate = formatDate(date);
51
51
  </Fragment>
52
52
  )
53
53
  }
54
- <h3>{title}</h3>
54
+ <h2>{title}</h2>
55
55
  <span class="timeline-location">{location}</span>
56
56
  {description && <p>{description}</p>}
57
57
  <slot />
@@ -0,0 +1,67 @@
1
+ ---
2
+ // warning: This file is overwritten by Astro Accelerator
3
+
4
+ import { getCollection, render } from "astro:content";
5
+ import type { Frontmatter } from "astro-accelerator-utils/types/Frontmatter";
6
+ import TimelineEvent from "@components/TimelineEvent.astro";
7
+ import Default from "./Default.astro";
8
+
9
+ type Props = {
10
+ frontmatter: Frontmatter & { isArchive?: boolean };
11
+ headings: { depth: number; slug: string; text: string }[];
12
+ };
13
+
14
+ const { frontmatter, headings } = Astro.props;
15
+ const isArchive = frontmatter.isArchive === true;
16
+
17
+ const events = await (async () => {
18
+ const now = new Date();
19
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
20
+ const collection = await getCollection("events", ({ data }) => {
21
+ return isArchive ? data.startDate < today : data.startDate >= today;
22
+ });
23
+
24
+ return collection.sort((a, b) => {
25
+ const aTime = a.data.startDate.getTime();
26
+ const bTime = b.data.startDate.getTime();
27
+ return isArchive ? bTime - aTime : aTime - bTime;
28
+ });
29
+ })();
30
+ ---
31
+
32
+ <Default frontmatter={frontmatter} headings={headings}>
33
+ <slot />
34
+
35
+ <div class="timeline" data-timeline>
36
+ {
37
+ await Promise.all(
38
+ events.map(async (event) => {
39
+ const { Content } = await render(event);
40
+ return (
41
+ <TimelineEvent
42
+ date={event.data.startDate}
43
+ endDate={event.data.endDate}
44
+ title={event.data.title}
45
+ location={event.data.location}
46
+ linkHref={event.data.linkHref}
47
+ linkText={event.data.linkText}>
48
+ <Content />
49
+ </TimelineEvent>
50
+ );
51
+ }),
52
+ )
53
+ }
54
+ </div>
55
+
56
+ {
57
+ isArchive ? (
58
+ <p>
59
+ <a href="/events/">Return to upcoming events</a>
60
+ </p>
61
+ ) : (
62
+ <p>
63
+ <a href="/events-archive/">View the events archive</a>
64
+ </p>
65
+ )
66
+ }
67
+ </Default>