-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add Video / 2nd Hero Image to Home Layout #1340
Comments
I like the idea of adding video feature, but unless we change the design I think user should choose either image or video, not both, for the Hero component. I don't think I can come up with a decent design where both logo and video fit nicely together (not enough space). For the same reason, I'm not thinking of adding "image2" as well, because the design is not made for having 2 images. So something like Nuxt Content site has is cool I think. For more complex usage, such as having 2 images, should be done in customization as you mentioned. Because you need define how they're aligned, spaced, gaps, and such and it's way complicated to handle in config option 😅 But again, let's add Video feature! I was thinking to support famous video platform like YouTube and Vimeo to embed it. But do you think |
We can just provide a slot (#1062) with default content being the image. Users can then customize it to add video, etc.? |
Yes! For the customized image, I think that works. Video embedding I meant was, it would be cool if we can do this in frontmatter. ---
layout: home
video: https://youtube-url.com/...
--- And then the default theme will handle it and create beautiful looking component. Like it has Thumbnail and play button, and when user clicks it, it opens modal and make video decent amount of size and such 👀 But as you mentioned I think we can start from #1062 and I think it should cover many usecases 👍 |
Thanks for the feedback! I will watch #1062 :)
It would be nice to have the flexibility of a |
Refer this: https://vitepress.dev/guide/extending-default-theme#layout-slots <script setup>
import DefaultTheme from 'vitepress/theme'
</script>
<template>
<DefaultTheme.Layout>
<template #home-hero-image>
Put your video here ...
</template>
</DefaultTheme.Layout>
</template> |
@brc-dd thanks! I've implemented over here: This is part of this PR: |
Oh, the deploy preview for that does not show the video, did I do something wrong? I thought it would take place of the image on the right. Or maybe VitePress Here's my fork / branch: https://github.com/karlhorky/safeql/tree/add-video-to-homepage |
I think you forgot to bump vitepress' version there? |
Looks like it's working, thanks!! Kapture.2023-03-10.at.11.13.22.mp4Closing this issue. |
Is your feature request related to a problem? Please describe.
Currently, the
home
layout only allows for a single image, which may not be enough for some projects (eg. https://www.safeql.dev/ ), who may want to have one large image and then also a video of the product, both in the upper hero section of the page.Describe the solution you'd like
It would be nice to have a more customizable / flexible way to output arbitrary (html or markdown) content, eg what I tried with the
tagline
here:Describe alternatives you've considered
If that's not an option, then having another configuration option like
image2
would be an alternative.Another alternative that I considered (but could not figure out) would be to somehow be able to extend ONLY this single section of that particular template, similar to what is being talked about here:
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: