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"
|
||||
title={
|
||||
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)
|
||||
}
|
||||
thumbnail={content.thumbnail.data.attributes}
|
||||
|
|
|
@ -30,12 +30,15 @@ export function prettyPrice(
|
|||
);
|
||||
}
|
||||
|
||||
export function prettySlug(slug: string, parentSlug?: string): string {
|
||||
if (parentSlug && slug.startsWith(parentSlug))
|
||||
slug = slug.substring(parentSlug.length + 1);
|
||||
slug = slug.replace(new RegExp("-", "g"), " ");
|
||||
slug = slug.replace(new RegExp("_", "g"), " ");
|
||||
return capitalizeString(slug);
|
||||
export function prettySlug(slug?: string, parentSlug?: string): string {
|
||||
if (slug) {
|
||||
if (parentSlug && slug.startsWith(parentSlug))
|
||||
slug = slug.substring(parentSlug.length + 1);
|
||||
slug = slug.replace(new RegExp("-", "g"), " ");
|
||||
slug = slug.replace(new RegExp("_", "g"), " ");
|
||||
return capitalizeString(slug);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
export function prettyinlineTitle(
|
||||
|
@ -73,9 +76,11 @@ export function prettyItemType(
|
|||
}
|
||||
}
|
||||
|
||||
export function prettyItemSubType(
|
||||
metadata: GetLibraryItemsPreviewQuery["libraryItems"]["data"][number]["attributes"]["metadata"][number]
|
||||
): string {
|
||||
export function prettyItemSubType(metadata: {
|
||||
__typename: GetLibraryItemsPreviewQuery["libraryItems"]["data"][number]["attributes"]["metadata"][number]["__typename"];
|
||||
subtype?: any;
|
||||
platform?: any;
|
||||
}): string {
|
||||
switch (metadata.__typename) {
|
||||
case "ComponentMetadataAudio":
|
||||
case "ComponentMetadataBooks":
|
||||
|
|
Loading…
Reference in New Issue