Skip to content

Commit

Permalink
redirect to correct playground url
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Sep 11, 2024
1 parent 74fe84e commit 25db002
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
allow-repeats: true
message: |
Deployed to Vercel Preview: ${{ steps.deploy.outputs.stdout }}
[Playground](${{ steps.deploy.outputs.stdout }}/playground.html)
[Playground](${{ steps.deploy.outputs.stdout }}/playground/)
[Storybook](${{ steps.deploy.outputs.stdout }}/storybook/)
# - run: git checkout next scripts/githubActions.mjs
- name: Get deployment alias
Expand Down
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ To open the console, press `F12`, or if you are on mobile, you can type `#dev` i

It should be easy to build/start the project locally. See [CONTRIBUTING.MD](./CONTRIBUTING.md) for more info. Also you can look at Dockerfile for reference.

There is world renderer playground ([link](https://mcon.vercel.app/playground)).
There is world renderer playground ([link](https://mcon.vercel.app/playground/)).

However, there are many things that can be done in online production version (like debugging actual source code). Also you can access some global variables in the console and there are a few useful examples:

Expand Down
4 changes: 2 additions & 2 deletions assets/playground.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- just redirect to /playground -->
<!-- just redirect to /playground/ -->
<script>
window.location.href = `/playground${window.location.search}`
window.location.href = `/playground/${window.location.search}`
</script>
6 changes: 6 additions & 0 deletions prismarine-viewer/playground.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
src: url(../../../assets/mojangles.ttf);
}
</style>
<script>
if (window.location.pathname.endsWith('playground')) {
// add trailing slash
window.location.href = `${window.location.origin}${window.location.pathname}/${window.location.search}`
}
</script>
</head>
<body>
<div id="root"></div>
Expand Down

0 comments on commit 25db002

Please sign in to comment.