-
Notifications
You must be signed in to change notification settings - Fork 85
feat: add 'Open in StackBlitz'-button #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
// initialize handlers on each page load as it's possible some pages disable openInStackBlitzLink | ||
document.addEventListener('astro:page-load', onInit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required even when transition:persist
is used due to:
- Disable
openInStackBlitzLink
on a single lesson - Open that lesson in fresh browser tab. The element is not mounted and scripts are not run.
- Navigate to a page that doesn't have
openInStackBlitzLink
disabled. Script tags are not run (due to ViewTransition I think), handler is not attached.
Using page-load
works always.
packages/astro/src/default/components/OpenInStackblitzLink.astro
Outdated
Show resolved
Hide resolved
Really cool PR! A few things we should do:
The rest is really great! I really love the idea of generating a "start" command in the |
Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like where this is going! Still a few things to fix and it should be good to go 🙌
packages/astro/src/default/components/OpenInStackblitzLink.astro
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAY!! Love this! Really good work on this front! 🤩 🥳
docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on this! 🤩
Adds an button on top bar that can be used to open current lesson and template code in separate StackBlitz project. Current code from editor is applied on top of the files.
Users can disable showing this button by defining
openInStackBlitzLink: false
in frontmatter metada. By default it's always visible.