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(theme): add team page feature #828

Merged
merged 1 commit into from Jun 22, 2022
Merged

feat(theme): add team page feature #828

merged 1 commit into from Jun 22, 2022

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented Jun 21, 2022

This PR adds a new "Team Page" feature. See more details in docs.

---
layout: page
---
<script setup>
import {
  VPTeamPage,
  VPTeamPageTitle,
  VPTeamMembers
} from 'vitepress/theme'

const members = [
  {
    avatar: 'https://www.github.com/yyx990803.png',
    name: 'Evan You',
    title: 'Creator',
    links: [
      { icon: 'github', link: 'https://github.com/yyx990803' },
      { icon: 'twitter', link: 'https://twitter.com/youyuxi' }
    ]
  },
  ...
]
</script>

<VPTeamPage>
  <VPTeamPageTitle>
    <template #title>Our Team</template>
    <template #lead>Lorem ipsum...</template>
  </VPTeamPageTitle>
  <VPTeamMembers :members="members" />
</VPTeamPage>

Screen_Shot_2022-06-17_at_0 23 51

Screen_Shot_2022-06-17_at_0 23 29

Why not frontmatter but component composition?

Because composing components are way more flexible.

Why not props for title and lead but instead slots?

Because it's way more flexible to add custom styles or even links inside a lead text.

@kiaking kiaking added enhancement New feature or request theme Related to the theme labels Jun 21, 2022
@kiaking kiaking added this to the v1.0.0 milestone Jun 21, 2022
@kiaking kiaking self-assigned this Jun 21, 2022
@kiaking kiaking merged commit 7cfe0f0 into main Jun 22, 2022
@kiaking kiaking deleted the team branch June 22, 2022 11:06
@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
enhancement New feature or request theme Related to the theme
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant