chore: improve frontpage visuals, frontmatter dx
This PR contains various chores and quality-of-life improvements related to the Lab's landing page. They're largely in separate commits, so no problem rolling back all or some changes.
Problem
Thumbnails had various sizes. #111
Solution
Make all thumbnails 16:9.
@JaimeTorrealba , have a look at the glass demo thumbnail. I couldn't retake it because the texture in the demo is very light on my screen. Feel free to push a new thumbnail to this PR, if you like.
Problem
Some demos had code examples in their .md files. Others did not. #90
Solution
- Remove code examples.
- Add a Github link to cards.
NOTE:
- Some demos had to be renamed slightly for the system to be able to match up e.g.,
components/content/glass-exampletocontent/experiements/glass-material.mdin order to make the Github links. - Github links are broken until files are merged – including those that had to be renamed – otherwise there aren't files to link to! :)
And since we are deriving Github links from demo names ...
Problem
.md frontmatter contained some fields that could be derived. E.g., from the path to content/experiments/my-awesome-demo we can derive:
-
title: My Awesome Demo -
thumbnail: my-awesome-demo.png -
slug: my-awesome-demo
Solution
- Allow users to specify these, but try to derive them if not provided.
- Remove the derivable fields from the
.mdfiles.
Problem
status: published tripped me up a few times
Solution
- Continue to accept
status: published, but if nostatusis set, assumepublished. - Add
status: unpublishedto the 'hidden' demos'.mdfiles.
Problem
Whitespace at the bottom of the screen in dark mode:
Solution
Fix the CSS. (Swap margin for padding.)
Closes #111, #90
@andretchen0 I think we should add also a Fab button to the single pages so the user can access directly the code similar of what threejs examples does
Hey @alvarosabu ,
I'll look into adding the code button to individual demos and push here.
Yeah, labels need some attention. I'll tackle those in a separate PR.
@andretchen0 I think we should add also a Fab button to the single pages so the user can access directly the code similar of what threejs examples does
I've added buttons to the demos.
It looks a bit unorganized in some of the demos as they add their own UI elements with different spacing/offsets.
Hey @JaimeTorrealba @alvarosabu ,
Bumping. Can we merge here? I think this takes care of all of @alvarosabu 's modification requests, but the PR hasn't been approved.
There's another lab demo in the works – #110 – and I'd like to get the updated lab online so we can spare ourselves the work of cropping thumbnails, etc.
Thanks!
Hey @andretchen0 I saw the new changes, they look good but there is something odd with the navigation and the github button.
For some reason if you enter an experiment from the index.vue and you click the github button, it takes you to the upper directory, while if you refresh the experiment page and click the github cta it goes to the expected github link
Try changing the Nuxt link for a normal anchor, sometimes NuxtLink does weird stuff when going to external links
https://github.com/Tresjs/lab/assets/4699008/805704bd-c214-47f8-848a-2f27b7350983
Thanks @alvarosabu for the pointer. I'll check it out.
@andretchen0 should we merge this one and you check the routing issue in another or we just wait?
Hey @alvarosabu ,
I've removed the NuxtLink on the code buttons. They're just normal <a>s now.
I wasn't able to reproduce the bug. Maybe something to do with how I'm running the dev site?
Are you able to reproduce the bug now? If so, any other ideas?
Fwiw, feel free to push to this branch if that helps us get to a merge.
Hey @alvarosabu , bumping. Could you have a look and tell me if we can merge and close here?
Thanks!