lightnet 3.1.2 → 3.3.0
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/CHANGELOG.md +33 -0
- package/__e2e__/fixtures/basics/node_modules/.bin/astro +2 -2
- package/__e2e__/fixtures/basics/node_modules/.bin/tsc +2 -2
- package/__e2e__/fixtures/basics/node_modules/.bin/tsserver +2 -2
- package/__e2e__/fixtures/basics/package.json +3 -3
- package/exports/details-page.ts +1 -0
- package/package.json +5 -5
- package/src/astro-integration/config.ts +7 -1
- package/src/astro-integration/integration.ts +4 -4
- package/src/astro-integration/virtual.d.ts +8 -3
- package/src/astro-integration/vite-plugin-lightnet-config.ts +9 -3
- package/src/layouts/Page.astro +8 -4
- package/src/pages/details-page/AudioDetailsPage.astro +11 -8
- package/src/pages/details-page/DefaultDetailsPage.astro +13 -10
- package/src/pages/details-page/{DetailsPage.astro → DetailsPageRoute.astro} +8 -23
- package/src/pages/details-page/VideoDetailsPage.astro +8 -5
- package/src/pages/details-page/components/DetailsPage.astro +18 -0
- /package/src/pages/{404.astro → 404Route.astro} +0 -0
- /package/src/pages/{RedirectToDefaultLocale.astro → RootRoute.astro} +0 -0
- /package/src/pages/search-page/{SearchPage.astro → SearchPageRoute.astro} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# lightnet
|
|
2
2
|
|
|
3
|
+
## 3.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#250](https://github.com/LightNetDev/LightNet/pull/250) [`bc728aa`](https://github.com/LightNetDev/LightNet/commit/bc728aae93cdba4383167488536e5c6ab3654523) Thanks [@smn-cds](https://github.com/smn-cds)! - Introduce DetailsPage wrapper component
|
|
8
|
+
|
|
9
|
+
‼️ BREAKING CHANGE on experimental custom details page API.
|
|
10
|
+
|
|
11
|
+
With this change all custom details pages need to be wrapped by
|
|
12
|
+
a `DetailsPage` component. This component is exported by `@lightnet/experimental-details-page`.
|
|
13
|
+
Previously custom details pages were automatically wrapped by LightNet.
|
|
14
|
+
|
|
15
|
+
This is how to create a custom details page:
|
|
16
|
+
|
|
17
|
+
```astro
|
|
18
|
+
---
|
|
19
|
+
import { DetailsPage } from "@lightNet/experimental-details-page"
|
|
20
|
+
type Props = {
|
|
21
|
+
mediaId
|
|
22
|
+
}
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<DetailsPage mediaId={Astro.props.mediaId}>
|
|
26
|
+
{/* Your custom details page components go here */}
|
|
27
|
+
</DetailsPage>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 3.2.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- [#246](https://github.com/LightNetDev/LightNet/pull/246) [`7c59151`](https://github.com/LightNetDev/LightNet/commit/7c59151a0d2eb698eff9891d0ba780ab29a6efe5) Thanks [@smn-cds](https://github.com/smn-cds)! - Add config option to set a footer component.
|
|
35
|
+
|
|
3
36
|
## 3.1.2
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -6,9 +6,9 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.
|
|
9
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.
|
|
11
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules/astro/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/astro@5.6.1_@types+node@22.14.0_jiti@2.4.2_lightningcss@1.29.1_rollup@4.39.0_terser@5.39.0_typescript@5.8.3_yaml@2.7.1/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
14
|
exec "$basedir/node" "$basedir/../astro/astro.js" "$@"
|
|
@@ -6,9 +6,9 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.
|
|
9
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.
|
|
11
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
14
|
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
@@ -6,9 +6,9 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.
|
|
9
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.
|
|
11
|
+
export NODE_PATH="/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/bin/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules/typescript/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/typescript@5.8.3/node_modules:/home/runner/work/LightNet/LightNet/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
14
|
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"@astrojs/react": "^4.2.3",
|
|
8
8
|
"@astrojs/tailwind": "^6.0.2",
|
|
9
9
|
"@lightnet/decap-admin": "^3.1.0",
|
|
10
|
-
"astro": "^5.6.
|
|
11
|
-
"lightnet": "^3.
|
|
10
|
+
"astro": "^5.6.1",
|
|
11
|
+
"lightnet": "^3.3.0",
|
|
12
12
|
"react": "^19.1.0",
|
|
13
13
|
"react-dom": "^19.1.0",
|
|
14
14
|
"sharp": "^0.33.5",
|
|
15
15
|
"tailwindcss": "^3.4.17",
|
|
16
|
-
"typescript": "^5.8.
|
|
16
|
+
"typescript": "^5.8.3"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/exports/details-page.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { default as ContentSection } from "../src/pages/details-page/components/ContentSection.astro"
|
|
6
6
|
export { default as DescriptionSection } from "../src/pages/details-page/components/DescriptionSection.astro"
|
|
7
|
+
export { default as DetailsPage } from "../src/pages/details-page/components/DetailsPage.astro"
|
|
7
8
|
export { default as OpenButton } from "../src/pages/details-page/components/main-details/OpenButton.astro"
|
|
8
9
|
export { default as ShareButton } from "../src/pages/details-page/components/main-details/ShareButton.astro"
|
|
9
10
|
export { default as MainDetailsSection } from "../src/pages/details-page/components/MainDetailsSection.astro"
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "lightnet",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.3.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/LightNetDev/lightnet",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"./locals": "./src/i18n/locals.ts",
|
|
26
26
|
"./tailwind.config.ts": "./tailwind.config.ts",
|
|
27
27
|
"./layouts/MarkdownPage.astro": "./src/layouts/MarkdownPage.astro",
|
|
28
|
-
"./pages/
|
|
29
|
-
"./pages/
|
|
30
|
-
"./pages/
|
|
31
|
-
"./pages/
|
|
28
|
+
"./pages/404Route.astro": "./src/pages/404Route.astro",
|
|
29
|
+
"./pages/RootRoute.astro": "./src/pages/RootRoute.astro",
|
|
30
|
+
"./pages/SearchPageRoute.astro": "./src/pages/search-page/SearchPageRoute.astro",
|
|
31
|
+
"./pages/DetailsPageRoute.astro": "./src/pages/details-page/DetailsPageRoute.astro",
|
|
32
32
|
"./pages/api/search.ts": "./src/pages/api/search.ts"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
@@ -180,12 +180,18 @@ export const configSchema = z.object({
|
|
|
180
180
|
*/
|
|
181
181
|
internalDomains: z.array(z.string()).default([]),
|
|
182
182
|
/**
|
|
183
|
-
* Path to an Astro component to be added
|
|
183
|
+
* Path to an Astro component to be added into the HTML head element of all pages.
|
|
184
184
|
* For example use this if you need to add an analytics script to every page.
|
|
185
185
|
*
|
|
186
186
|
* @example "./src/components/MyHeadTag.astro"
|
|
187
187
|
*/
|
|
188
188
|
headComponent: z.string().optional(),
|
|
189
|
+
/**
|
|
190
|
+
* Path to an Astro component to be added at the bottom of all pages.
|
|
191
|
+
*
|
|
192
|
+
* @example "./src/components/MyFooter.astro"
|
|
193
|
+
*/
|
|
194
|
+
footerComponent: z.string().optional(),
|
|
189
195
|
/**
|
|
190
196
|
* Configure search page behavior
|
|
191
197
|
*/
|
|
@@ -28,19 +28,19 @@ export function lightnet(lightnetConfig: LightnetConfig): AstroIntegration {
|
|
|
28
28
|
|
|
29
29
|
injectRoute({
|
|
30
30
|
pattern: "404",
|
|
31
|
-
entrypoint: "lightnet/pages/
|
|
31
|
+
entrypoint: "lightnet/pages/404Route.astro",
|
|
32
32
|
prerender: true,
|
|
33
33
|
})
|
|
34
34
|
|
|
35
35
|
injectRoute({
|
|
36
36
|
pattern: "",
|
|
37
|
-
entrypoint: "lightnet/pages/
|
|
37
|
+
entrypoint: "lightnet/pages/RootRoute.astro",
|
|
38
38
|
prerender: true,
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
injectRoute({
|
|
42
42
|
pattern: "/[locale]/media",
|
|
43
|
-
entrypoint: "lightnet/pages/
|
|
43
|
+
entrypoint: "lightnet/pages/SearchPageRoute.astro",
|
|
44
44
|
prerender: true,
|
|
45
45
|
})
|
|
46
46
|
|
|
@@ -52,7 +52,7 @@ export function lightnet(lightnetConfig: LightnetConfig): AstroIntegration {
|
|
|
52
52
|
|
|
53
53
|
injectRoute({
|
|
54
54
|
pattern: "/[locale]/media/[mediaId]",
|
|
55
|
-
entrypoint: "lightnet/pages/
|
|
55
|
+
entrypoint: "lightnet/pages/DetailsPageRoute.astro",
|
|
56
56
|
prerender: true,
|
|
57
57
|
})
|
|
58
58
|
|
|
@@ -13,7 +13,12 @@ declare module "virtual:lightnet/project-context" {
|
|
|
13
13
|
export default context
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
declare module "virtual:lightnet/components/
|
|
17
|
-
const
|
|
18
|
-
export default
|
|
16
|
+
declare module "virtual:lightnet/components/CustomHead" {
|
|
17
|
+
const CustomHead: ((props: Record<string, any>) => any) | undefined
|
|
18
|
+
export default CustomHead
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare module "virtual:lightnet/components/CustomFooter" {
|
|
22
|
+
const CustomFooter: ((props: Record<string, any>) => any) | undefined
|
|
23
|
+
export default CustomFooter
|
|
19
24
|
}
|
|
@@ -8,13 +8,15 @@ import { type LightnetConfig } from "./config"
|
|
|
8
8
|
const CONFIG = "virtual:lightnet/config"
|
|
9
9
|
const LOGO = "virtual:lightnet/logo"
|
|
10
10
|
const PROJECT_CONTEXT = "virtual:lightnet/project-context"
|
|
11
|
-
const
|
|
11
|
+
const CUSTOM_HEAD = "virtual:lightnet/components/CustomHead"
|
|
12
|
+
const CUSTOM_FOOTER = "virtual:lightnet/components/CustomFooter"
|
|
12
13
|
|
|
13
14
|
const VIRTUAL_MODULES = [
|
|
14
15
|
CONFIG,
|
|
15
16
|
LOGO,
|
|
16
17
|
PROJECT_CONTEXT,
|
|
17
|
-
|
|
18
|
+
CUSTOM_HEAD,
|
|
19
|
+
CUSTOM_FOOTER,
|
|
18
20
|
] as const
|
|
19
21
|
|
|
20
22
|
export function vitePluginLightnetConfig(
|
|
@@ -52,10 +54,14 @@ export function vitePluginLightnetConfig(
|
|
|
52
54
|
: "export default undefined;"
|
|
53
55
|
case PROJECT_CONTEXT:
|
|
54
56
|
return `export default ${JSON.stringify({ root, srcDir, site })}`
|
|
55
|
-
case
|
|
57
|
+
case CUSTOM_HEAD:
|
|
56
58
|
return config.headComponent
|
|
57
59
|
? `export { default } from ${resolveFilePath(config.headComponent)};`
|
|
58
60
|
: "export default undefined;"
|
|
61
|
+
case CUSTOM_FOOTER:
|
|
62
|
+
return config.footerComponent
|
|
63
|
+
? `export { default } from ${resolveFilePath(config.footerComponent)};`
|
|
64
|
+
: "export default undefined;"
|
|
59
65
|
}
|
|
60
66
|
},
|
|
61
67
|
}
|
package/src/layouts/Page.astro
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { ClientRouter } from "astro:transitions"
|
|
3
|
-
import
|
|
3
|
+
import CustomFooter from "virtual:lightnet/components/CustomFooter"
|
|
4
|
+
import CustomHead from "virtual:lightnet/components/CustomHead"
|
|
4
5
|
import config from "virtual:lightnet/config"
|
|
5
6
|
|
|
6
7
|
import { resolveLanguage } from "../i18n/resolve-language"
|
|
@@ -26,7 +27,7 @@ const language = resolveLanguage(currentLocale)
|
|
|
26
27
|
<head>
|
|
27
28
|
<meta charset="UTF-8" />
|
|
28
29
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
29
|
-
{
|
|
30
|
+
{CustomHead && <CustomHead />}
|
|
30
31
|
<title>{title ? `${title} | ${configTitle}` : configTitle}</title>
|
|
31
32
|
{description && <meta name="description" content={description} />}
|
|
32
33
|
{config.manifest && <link rel="manifest" href={config.manifest} />}
|
|
@@ -34,7 +35,9 @@ const language = resolveLanguage(currentLocale)
|
|
|
34
35
|
<Favicon />
|
|
35
36
|
<ClientRouter />
|
|
36
37
|
</head>
|
|
37
|
-
<body
|
|
38
|
+
<body
|
|
39
|
+
class="flex min-h-screen flex-col overflow-y-scroll bg-gray-50 text-gray-900"
|
|
40
|
+
>
|
|
38
41
|
<header
|
|
39
42
|
class="fixed top-0 z-50 h-14 w-full bg-white shadow-lg sm:h-20"
|
|
40
43
|
transition:animate="none"
|
|
@@ -46,9 +49,10 @@ const language = resolveLanguage(currentLocale)
|
|
|
46
49
|
<PageNavigation />
|
|
47
50
|
</div>
|
|
48
51
|
</header>
|
|
49
|
-
<main class="
|
|
52
|
+
<main class="grow pb-8 pt-14 sm:py-20">
|
|
50
53
|
<slot />
|
|
51
54
|
</main>
|
|
55
|
+
{CustomFooter && <CustomFooter />}
|
|
52
56
|
<PreloadReact client:idle />
|
|
53
57
|
</body>
|
|
54
58
|
</html>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { getMediaItem } from "../../content/get-media-items"
|
|
3
3
|
import ContentSection from "./components/ContentSection.astro"
|
|
4
4
|
import DescriptionSection from "./components/DescriptionSection.astro"
|
|
5
|
+
import DetailsPage from "./components/DetailsPage.astro"
|
|
5
6
|
import AudioPlayer from "./components/main-details/AudioPlayer.astro"
|
|
6
7
|
import ShareButton from "./components/main-details/ShareButton.astro"
|
|
7
8
|
import MainDetailsSection from "./components/MainDetailsSection.astro"
|
|
@@ -16,11 +17,13 @@ const { mediaId } = Astro.props
|
|
|
16
17
|
const audioSrc = (await getMediaItem(mediaId)).data.content[0].url
|
|
17
18
|
---
|
|
18
19
|
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
<
|
|
20
|
+
<DetailsPage mediaId={mediaId}>
|
|
21
|
+
<MainDetailsSection mediaId={mediaId}>
|
|
22
|
+
<AudioPlayer src={audioSrc} className="mt-10 w-full" />
|
|
23
|
+
<ShareButton className="mt-4 min-w-40" />
|
|
24
|
+
</MainDetailsSection>
|
|
25
|
+
<DescriptionSection mediaId={mediaId} />
|
|
26
|
+
<ContentSection mediaId={mediaId} />
|
|
27
|
+
<MediaCollectionsSection mediaId={mediaId} />
|
|
28
|
+
<MoreDetailsSection mediaId={mediaId} />
|
|
29
|
+
</DetailsPage>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import ContentSection from "./components/ContentSection.astro"
|
|
3
3
|
import DescriptionSection from "./components/DescriptionSection.astro"
|
|
4
|
+
import DetailsPage from "./components/DetailsPage.astro"
|
|
4
5
|
import OpenButton from "./components/main-details/OpenButton.astro"
|
|
5
6
|
import ShareButton from "./components/main-details/ShareButton.astro"
|
|
6
7
|
import MainDetailsSection from "./components/MainDetailsSection.astro"
|
|
@@ -16,13 +17,15 @@ export type Props = {
|
|
|
16
17
|
const { mediaId, coverStyle, openActionLabel = "ln.details.open" } = Astro.props
|
|
17
18
|
---
|
|
18
19
|
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
20
|
+
<DetailsPage mediaId={mediaId}>
|
|
21
|
+
<MainDetailsSection mediaId={mediaId} coverStyle={coverStyle}>
|
|
22
|
+
<div class="mt-10 flex flex-col justify-center gap-4 sm:justify-start">
|
|
23
|
+
<OpenButton mediaId={mediaId} openActionLabel={openActionLabel} />
|
|
24
|
+
<ShareButton />
|
|
25
|
+
</div>
|
|
26
|
+
</MainDetailsSection>
|
|
27
|
+
<DescriptionSection mediaId={mediaId} />
|
|
28
|
+
<ContentSection mediaId={mediaId} />
|
|
29
|
+
<MediaCollectionsSection mediaId={mediaId} />
|
|
30
|
+
<MoreDetailsSection mediaId={mediaId} />
|
|
31
|
+
</DetailsPage>
|
|
@@ -6,8 +6,6 @@ import config from "virtual:lightnet/config"
|
|
|
6
6
|
import { getMediaItem, getMediaItems } from "../../content/get-media-items"
|
|
7
7
|
import { getMediaType } from "../../content/get-media-types"
|
|
8
8
|
import { resolveLocales } from "../../i18n/resolve-locales"
|
|
9
|
-
import Page from "../../layouts/Page.astro"
|
|
10
|
-
import { markdownToText } from "../../utils/markdown"
|
|
11
9
|
import AudioDetailsPage from "./AudioDetailsPage.astro"
|
|
12
10
|
import DefaultDetailsPage from "./DefaultDetailsPage.astro"
|
|
13
11
|
import VideoDetailsPage from "./VideoDetailsPage.astro"
|
|
@@ -43,24 +41,11 @@ if (detailsPage?.layout === "custom") {
|
|
|
43
41
|
}
|
|
44
42
|
---
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
{
|
|
56
|
-
layout === "video" && (
|
|
57
|
-
<VideoDetailsPage mediaId={mediaId} {...detailsPage} />
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
{
|
|
61
|
-
layout === "audio" && (
|
|
62
|
-
<AudioDetailsPage mediaId={mediaId} {...detailsPage} />
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
{CustomDetails && <CustomDetails mediaId={mediaId} {...detailsPage} />}
|
|
66
|
-
</Page>
|
|
44
|
+
{
|
|
45
|
+
layout === "default" && (
|
|
46
|
+
<DefaultDetailsPage mediaId={mediaId} {...detailsPage} />
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
{layout === "video" && <VideoDetailsPage mediaId={mediaId} {...detailsPage} />}
|
|
50
|
+
{layout === "audio" && <AudioDetailsPage mediaId={mediaId} {...detailsPage} />}
|
|
51
|
+
{CustomDetails && <CustomDetails mediaId={mediaId} {...detailsPage} />}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import ContentSection from "./components/ContentSection.astro"
|
|
3
3
|
import DescriptionSection from "./components/DescriptionSection.astro"
|
|
4
|
+
import DetailsPage from "./components/DetailsPage.astro"
|
|
4
5
|
import MediaCollectionsSection from "./components/MediaCollectionsSection.astro"
|
|
5
6
|
import MoreDetailsSection from "./components/MoreDetailsSection.astro"
|
|
6
7
|
import VideoDetailsSection from "./components/VideoDetailsSection.astro"
|
|
@@ -12,8 +13,10 @@ export type Props = {
|
|
|
12
13
|
const { mediaId } = Astro.props
|
|
13
14
|
---
|
|
14
15
|
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
16
|
+
<DetailsPage mediaId={mediaId}>
|
|
17
|
+
<VideoDetailsSection mediaId={mediaId} />
|
|
18
|
+
<DescriptionSection mediaId={mediaId} />
|
|
19
|
+
<ContentSection mediaId={mediaId} />
|
|
20
|
+
<MediaCollectionsSection mediaId={mediaId} />
|
|
21
|
+
<MoreDetailsSection mediaId={mediaId} />
|
|
22
|
+
</DetailsPage>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { getMediaItem } from "../../../content/get-media-items"
|
|
3
|
+
import Page from "../../../layouts/Page.astro"
|
|
4
|
+
import { markdownToText } from "../../../utils/markdown"
|
|
5
|
+
|
|
6
|
+
type Props = {
|
|
7
|
+
mediaId: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const mediaItem = (await getMediaItem(Astro.props.mediaId)).data
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<Page
|
|
14
|
+
title={mediaItem.title}
|
|
15
|
+
description={markdownToText(mediaItem.description)}
|
|
16
|
+
>
|
|
17
|
+
<slot />
|
|
18
|
+
</Page>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|