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 +1 -1
- package/src/layouts/Author.astro +8 -8
- package/src/layouts/Default.astro +12 -8
- package/src/layouts/Events.astro +21 -0
- package/src/layouts/Redirect.astro +8 -7
- package/src/layouts/Search.astro +12 -11
- package/src/themes/accelerator/components/TimelineEvent.astro +1 -1
- package/src/themes/accelerator/layouts/Events.astro +67 -0
package/package.json
CHANGED
package/src/layouts/Author.astro
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
// warning: This file is overwritten by Astro Accelerator
|
|
3
3
|
|
|
4
|
-
import type { Frontmatter } from
|
|
5
|
-
import
|
|
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
|
-
|
|
14
|
+
|
|
15
|
+
<AuthorLayout frontmatter={frontmatter} headings={headings}>
|
|
16
16
|
<slot />
|
|
17
|
-
</
|
|
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
|
|
5
|
-
import
|
|
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
|
|
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
|
-
|
|
15
|
+
|
|
16
|
+
<DefaultLayout
|
|
17
|
+
frontmatter={frontmatter}
|
|
18
|
+
headings={headings}
|
|
19
|
+
breadcrumbs={breadcrumbs}>
|
|
16
20
|
<slot />
|
|
17
|
-
</
|
|
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
|
|
5
|
-
import
|
|
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
|
-
|
|
14
|
+
|
|
15
|
+
<RedirectLayout frontmatter={frontmatter} headings={headings}>
|
|
15
16
|
<slot />
|
|
16
|
-
</
|
|
17
|
+
</RedirectLayout>
|
package/src/layouts/Search.astro
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type { Frontmatter } from
|
|
3
|
-
import { SITE } from
|
|
4
|
-
import { Lang } from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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
|
-
|
|
19
|
+
|
|
20
|
+
<DefaultLayout frontmatter={frontmatter} headings={headings}>
|
|
20
21
|
<slot />
|
|
21
|
-
<
|
|
22
|
-
</
|
|
22
|
+
<SearchComponent lang={lang} showSearch={true} />
|
|
23
|
+
</DefaultLayout>
|
|
@@ -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>
|