Skip to content

Commit bb3fc8e

Browse files
committed
test new gitpuller button
1 parent 2d9917a commit bb3fc8e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

book/_static/custom_launch_button.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ window.addEventListener("DOMContentLoaded", () => {
4343
const modal = document.getElementById("customModal");
4444

4545
launchBtn.addEventListener("click", () => {
46-
const url = input.value.trim();
47-
if (url.startsWith("https://") && (url.endsWith(".ewatercycle-tud.src.surf-hosted.nl/jupyter")) ) {
48-
window.open(`${url}`, "_blank");
46+
const baseUrl = input.value.trim();
47+
48+
if (baseUrl.startsWith("https://")) {
49+
const repo = encodeURIComponent("https://github.com/eWaterCycle/getting-started");
50+
const branch = "main";
51+
const notebookPath = "book/intro.md"; // Change to your desired notebook
52+
53+
const nbgitpullerUrl = `${baseUrl}/hub/user-redirect/git-pull?repo=${repo}&branch=${branch}&urlpath=lab/tree/${notebookPath}`;
54+
window.open(nbgitpullerUrl, "_blank");
4955
modal.style.display = "none";
5056
input.value = "";
5157
} else {

0 commit comments

Comments
 (0)