From 7eb036de9f93ea72c12fcfe295eef5e696faacde Mon Sep 17 00:00:00 2001 From: BaskarMitrah Date: Tue, 3 Mar 2026 18:55:35 +0530 Subject: [PATCH 1/3] added playground url for the stage --- hlx_statics/scripts/scripts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hlx_statics/scripts/scripts.js b/hlx_statics/scripts/scripts.js index 9df5cfaf..d29f1f12 100644 --- a/hlx_statics/scripts/scripts.js +++ b/hlx_statics/scripts/scripts.js @@ -848,8 +848,11 @@ function loadPrism(document) { const pre = env.element.closest('pre'); const sessionId = pre?.getAttribute('data-playground-session-id'); const playgroundMode = pre?.getAttribute('data-playground-mode'); + const playgroundExecutionMode = pre?.getAttribute('data-playground-execution-mode'); - const playgroundURL = pre?.getAttribute('data-playground-url'); + const playgroundURL = isStageEnvironment(window.location.host) + ? (pre?.getAttribute('data-playground-url-stage') || pre?.getAttribute('data-playground-url')) + : pre?.getAttribute('data-playground-url'); if (!sessionId || !playgroundMode || !playgroundExecutionMode || !playgroundURL) return null; const btn = createTag('button', { class: 'try-code-button' }); btn.textContent = 'Try in playground'; From f666825b9bc9f188c880ff7f89f83065c9c609ea Mon Sep 17 00:00:00 2001 From: BaskarMitrah Date: Wed, 4 Mar 2026 12:25:56 +0530 Subject: [PATCH 2/3] added : local url test for playground --- hlx_statics/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hlx_statics/scripts/scripts.js b/hlx_statics/scripts/scripts.js index d29f1f12..c7efb6ce 100644 --- a/hlx_statics/scripts/scripts.js +++ b/hlx_statics/scripts/scripts.js @@ -850,7 +850,7 @@ function loadPrism(document) { const playgroundMode = pre?.getAttribute('data-playground-mode'); const playgroundExecutionMode = pre?.getAttribute('data-playground-execution-mode'); - const playgroundURL = isStageEnvironment(window.location.host) + const playgroundURL = isStageEnvironment(window.location.host) || isHlxPath(window.location.host) ? (pre?.getAttribute('data-playground-url-stage') || pre?.getAttribute('data-playground-url')) : pre?.getAttribute('data-playground-url'); if (!sessionId || !playgroundMode || !playgroundExecutionMode || !playgroundURL) return null; From 4b203566067ed7cd732757ea78dc23336575490a Mon Sep 17 00:00:00 2001 From: BaskarMitrah Date: Thu, 5 Mar 2026 10:31:24 +0530 Subject: [PATCH 3/3] checked islocal path --- hlx_statics/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hlx_statics/scripts/scripts.js b/hlx_statics/scripts/scripts.js index c7efb6ce..7b02b299 100644 --- a/hlx_statics/scripts/scripts.js +++ b/hlx_statics/scripts/scripts.js @@ -850,7 +850,7 @@ function loadPrism(document) { const playgroundMode = pre?.getAttribute('data-playground-mode'); const playgroundExecutionMode = pre?.getAttribute('data-playground-execution-mode'); - const playgroundURL = isStageEnvironment(window.location.host) || isHlxPath(window.location.host) + const playgroundURL = isStageEnvironment(window.location.host) || isLocalHostEnvironment(window.location.host) ? (pre?.getAttribute('data-playground-url-stage') || pre?.getAttribute('data-playground-url')) : pre?.getAttribute('data-playground-url'); if (!sessionId || !playgroundMode || !playgroundExecutionMode || !playgroundURL) return null;