Skip to content

Fix broken example links#348

Merged
dmarcos merged 3 commits into
sparkjsdev:mainfrom
mikeyzhong:fix-examples-link
May 18, 2026
Merged

Fix broken example links#348
dmarcos merged 3 commits into
sparkjsdev:mainfrom
mikeyzhong:fix-examples-link

Conversation

@mikeyzhong
Copy link
Copy Markdown
Contributor

For any example if you click the code link it leads to a broken page.

e.g. https://sparkjs.dev/examples/#particle-simulation

@mrxz
Copy link
Copy Markdown
Collaborator

mrxz commented May 18, 2026

Thanks, this addresses #328.

With your changes the URLs aren't normalized, so it might be cleaner to do the following:

- codeButton.href = `https://github.com/sparkjsdev/spark/blob/main/examples/${path}`;
+ codeButton.href = new URL(`https://github.com/sparkjsdev/spark/blob/main/examples/${path}`).toString();

@mikeyzhong
Copy link
Copy Markdown
Contributor Author

Thanks, made the change.

@dmarcos
Copy link
Copy Markdown
Contributor

dmarcos commented May 18, 2026

Thanks so much!

@dmarcos dmarcos merged commit 8435d5a into sparkjsdev:main May 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants