feat: add hero slots that are inside container (#3524)

pull/3385/merge
JD Solanki 10 months ago committed by GitHub
parent 6b1f951928
commit 28870e68fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -195,7 +195,9 @@ Full list of slots available in the default theme layout:
- `aside-ads-after` - `aside-ads-after`
- When `layout: 'home'` is enabled via frontmatter: - When `layout: 'home'` is enabled via frontmatter:
- `home-hero-before` - `home-hero-before`
- `home-hero-info-before`
- `home-hero-info` - `home-hero-info`
- `home-hero-actions-after`
- `home-hero-image` - `home-hero-image`
- `home-hero-after` - `home-hero-after`
- `home-features-before` - `home-features-before`

@ -194,7 +194,9 @@ export default {
- `aside-ads-after` - `aside-ads-after`
- 当 `layout: 'home'` 在 frontmatter 中被启用时: - 当 `layout: 'home'` 在 frontmatter 中被启用时:
- `home-hero-before` - `home-hero-before`
- `home-hero-info-before`
- `home-hero-info` - `home-hero-info`
- `home-hero-actions-after`
- `home-hero-image` - `home-hero-image`
- `home-hero-after` - `home-hero-after`
- `home-features-before` - `home-features-before`

@ -25,6 +25,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
<div class="VPHero" :class="{ 'has-image': image || heroImageSlotExists }"> <div class="VPHero" :class="{ 'has-image': image || heroImageSlotExists }">
<div class="container"> <div class="container">
<div class="main"> <div class="main">
<slot name="home-hero-info-before" />
<slot name="home-hero-info"> <slot name="home-hero-info">
<h1 v-if="name" class="name"> <h1 v-if="name" class="name">
<span v-html="name" class="clip"></span> <span v-html="name" class="clip"></span>
@ -32,6 +33,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
<p v-if="text" v-html="text" class="text"></p> <p v-if="text" v-html="text" class="text"></p>
<p v-if="tagline" v-html="tagline" class="tagline"></p> <p v-if="tagline" v-html="tagline" class="tagline"></p>
</slot> </slot>
<slot name="home-hero-info-after" />
<div v-if="actions" class="actions"> <div v-if="actions" class="actions">
<div v-for="action in actions" :key="action.link" class="action"> <div v-for="action in actions" :key="action.link" class="action">
@ -44,6 +46,7 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
/> />
</div> </div>
</div> </div>
<slot name="home-hero-actions-after" />
</div> </div>
<div v-if="image || heroImageSlotExists" class="image"> <div v-if="image || heroImageSlotExists" class="image">

Loading…
Cancel
Save