Tested deployment
This commit is contained in:
parent
d1ca0c1d7e
commit
0bc2a5ab0f
|
@ -0,0 +1 @@
|
||||||
|
npx next build
|
|
@ -0,0 +1 @@
|
||||||
|
npx next start -p 12500
|
|
@ -70,7 +70,11 @@ export default function ContentIndex(props: ContentIndexProps): JSX.Element {
|
||||||
navTitle="Contents"
|
navTitle="Contents"
|
||||||
title={
|
title={
|
||||||
content.titles.length > 0
|
content.titles.length > 0
|
||||||
? prettyinlineTitle(content.titles[0].pre_title, content.titles[0].title, content.titles[0].subtitle)
|
? prettyinlineTitle(
|
||||||
|
content.titles[0].pre_title,
|
||||||
|
content.titles[0].title,
|
||||||
|
content.titles[0].subtitle
|
||||||
|
)
|
||||||
: prettySlug(content.slug)
|
: prettySlug(content.slug)
|
||||||
}
|
}
|
||||||
thumbnail={content.thumbnail.data.attributes}
|
thumbnail={content.thumbnail.data.attributes}
|
||||||
|
|
|
@ -30,12 +30,15 @@ export function prettyPrice(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function prettySlug(slug: string, parentSlug?: string): string {
|
export function prettySlug(slug?: string, parentSlug?: string): string {
|
||||||
if (parentSlug && slug.startsWith(parentSlug))
|
if (slug) {
|
||||||
slug = slug.substring(parentSlug.length + 1);
|
if (parentSlug && slug.startsWith(parentSlug))
|
||||||
slug = slug.replace(new RegExp("-", "g"), " ");
|
slug = slug.substring(parentSlug.length + 1);
|
||||||
slug = slug.replace(new RegExp("_", "g"), " ");
|
slug = slug.replace(new RegExp("-", "g"), " ");
|
||||||
return capitalizeString(slug);
|
slug = slug.replace(new RegExp("_", "g"), " ");
|
||||||
|
return capitalizeString(slug);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function prettyinlineTitle(
|
export function prettyinlineTitle(
|
||||||
|
@ -73,9 +76,11 @@ export function prettyItemType(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function prettyItemSubType(
|
export function prettyItemSubType(metadata: {
|
||||||
metadata: GetLibraryItemsPreviewQuery["libraryItems"]["data"][number]["attributes"]["metadata"][number]
|
__typename: GetLibraryItemsPreviewQuery["libraryItems"]["data"][number]["attributes"]["metadata"][number]["__typename"];
|
||||||
): string {
|
subtype?: any;
|
||||||
|
platform?: any;
|
||||||
|
}): string {
|
||||||
switch (metadata.__typename) {
|
switch (metadata.__typename) {
|
||||||
case "ComponentMetadataAudio":
|
case "ComponentMetadataAudio":
|
||||||
case "ComponentMetadataBooks":
|
case "ComponentMetadataBooks":
|
||||||
|
|
Loading…
Reference in New Issue