diff --git a/.changeset/seven-views-pull.md b/.changeset/seven-views-pull.md new file mode 100644 index 0000000..0cd0a24 --- /dev/null +++ b/.changeset/seven-views-pull.md @@ -0,0 +1,5 @@ +--- +"@curvenote/quantecon-book": patch +--- + +Fix colab link for lecture repo ending with .myst diff --git a/app/components/toolbar/LaunchButton.tsx b/app/components/toolbar/LaunchButton.tsx index a13628f..62a7f27 100644 --- a/app/components/toolbar/LaunchButton.tsx +++ b/app/components/toolbar/LaunchButton.tsx @@ -31,7 +31,10 @@ function LaunchPanel() { const [privateServiceUrl, setPrivateServiceUrl] = React.useState(); const hasGitHub = !!project?.github; - const orgRepo = project?.github ? new URL(project?.github).pathname.slice(1) : undefined; + // Remove the `.myst` suffix from the orgRepo URL if present. + const orgRepo = project?.github + ? new URL(project?.github).pathname.slice(1).replace(/\.myst$/, '') + : undefined; const filename = `${page?.location.split('.')[0]}.ipynb`; const handleSelect = React.useCallback((value: string) => setService(value), []);