From fc910dc3f7c89cda9a1b214d0b7fe160f73714d9 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Mon, 6 Nov 2023 23:11:48 +0100 Subject: [PATCH] set the inage link in the array to the new path and name --- page-generator/index.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/page-generator/index.php b/page-generator/index.php index 16fbf8d..26a69f4 100644 --- a/page-generator/index.php +++ b/page-generator/index.php @@ -24,8 +24,12 @@ $image_list = json_decode($image_list, true); print_r($image_list); // copy images from whatever they are (if this is in a docker container they may be mounted somewhere) -foreach ($image_list as $image) { - copy(SRC_PATH . $image['path'], BASE_PATH_TEMP . "/assets/img/" . $image['id'] . '.' . pathinfo($image['path'], PATHINFO_EXTENSION)); +foreach ($image_list as $key => $image) { + $old_path = SRC_PATH . $image['path']; + $new_path = BASE_PATH_TEMP . "/assets/img/" . $image['id'] . '.' . pathinfo($image['path'], PATHINFO_EXTENSION); + copy($old_path, $new_path); + + $image_list[$key]['path'] = "../assets/img/" . $image['id'] . '.' . pathinfo($image['path'], PATHINFO_EXTENSION); } // create partials: -- 2.30.2