Skip to content
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

feat: home slot for customizing the entire homepage easily #314

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

soulsam480
Copy link
Contributor

This PR adds a slot for the entire home page for easy customization

Reason

  • Currently when someone wants to just modify the homepage with custom style, it's not possible to extend.
  • The current homepage slots i.e. home-hero. home-features, home-footer only allow customizing specific parts.

How this addition helps

Currently

<script setup lang="ts">
import Layout from 'vitepress/dist/client/theme-default/Layout.vue';
</script>

<template>
  <Layout>
    <template #home-hero>
      <p>My custom hero data</p>
    </template>
    <template #home-features>
      <p>My custom feature data</p>
    </template>
    <template #home-footer>
      <p>My custom footer data</p>
    </template>
  </Layout>
</template>

In this pr

<script setup lang="ts">
import Home from './components/Home.vue';
import Layout from 'vitepress/dist/client/theme-default/Layout.vue';
</script>

<template>
  <Layout>
    <template #home>
      <Home />
    </template>
  </Layout>
</template>

This will add more flexibility to vitepress while customizing the default Homepage

@yyx990803 yyx990803 merged commit 07bf145 into vuejs:main Oct 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants