Tested deployment

This commit is contained in:
DrMint 2022-02-24 13:25:43 +01:00
parent d1ca0c1d7e
commit 0bc2a5ab0f
5 changed files with 21 additions and 10 deletions

1
run_accords_build.sh Executable file
View File

@ -0,0 +1 @@
npx next build

1
run_accords_prod.sh Executable file
View File

@ -0,0 +1 @@
npx next start -p 12500

View File

@ -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}

View File

@ -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":