From 1bc1ef257828dc244709ef00c55cae1cdce016f7 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 6 Feb 2022 12:51:23 +0100 Subject: [PATCH] Don't use a white background icon logo if a png is the logo, detect public URL automatically --- scripts/build.sh | 9 ++++++++- scripts/generateLayouts.ts | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index fe0c707898..76acf443ba 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -35,9 +35,16 @@ then echo "Source maps are enabled" fi +if [ $BRANCH = "master" ] +then + PUBLIC_URL="./" +else + PUBLIC_URL="./mc/$BRANCH" +fi + echo -e "\n\n Building non-theme pages" echo -e " ==========================\n\n" -parcel build --public-url "./" $SRC_MAPS "index.html" "404.html" "professional.html" "automaton.html" "import_helper.html" "import_viewer.html" "land.html" "customGenerator.html" "theme.html" vendor +parcel build --public-url "$PUBLIC_URL" $SRC_MAPS "index.html" "404.html" "professional.html" "automaton.html" "import_helper.html" "import_viewer.html" "land.html" "customGenerator.html" "theme.html" vendor if [ $? -ne 0 ]; then echo "ERROR - stopping the build" exit 1 diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 697208a85f..bf26fad07d 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -179,7 +179,11 @@ async function createLandingPage(layout: LayoutConfig, manifest) { if (icon.type !== "image/png") { continue; } - apple_icons.push(``) + const whiteBgPath = `./assets/generated/generated_theme_${layout.id}_white_background${icon.sizes.substr(icon.sizes.indexOf("x")+ 1)}.png` + if(!existsSync(whiteBgPath)){ + continue + } + apple_icons.push(``) } let themeSpecific = [