Skip to content

Commit

Permalink
feat(organism): add TeamMembers. and optimize seo
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Dec 1, 2024
1 parent 9807ce9 commit 4c69c19
Show file tree
Hide file tree
Showing 15 changed files with 411 additions and 17 deletions.
3 changes: 2 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {defineConfig} from "vitepress";
import {apiAnchor} from "@tsed/vitepress-theme/markdown/api-anchor/api-anchor.js";

import team from "../team.json";
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Ts.ED",
Expand Down Expand Up @@ -33,6 +33,7 @@ export default defineConfig({
apiUrl: "/api.json",
apiRedirectUrl: "",
repo: "tsedio/tsed",
team,
githubProxyUrl: "https://api.tsed.io/rest/github/tsedio/tsed",
editLink: {
pattern: "https://github.com/tsedio/tsed-vitepress-theme/edit/main/docs/:path"
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {DefaultTheme} from "@tsed/vitepress-theme";
import type {Theme} from "vitepress";
import {h} from "vue";
import HomeBanner from "@tsed/vitepress-theme/organisms/home/HomeBanner.vue";
import HomePartners from "@tsed/vitepress-theme/organisms/home/HomePartners.vue";
import HomeBody from "@tsed/vitepress-theme/organisms/home/HomeBody.vue";
import HomeTabsTerminal from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabsTerminal.vue";
import HomeTabTerminalNpm from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalNpm.vue";
import HomeTabTerminalYarn from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalYarn.vue";
import HomeTabTerminalPnpm from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalPnpm.vue";
import HomeTabTerminalBun from "@tsed/vitepress-theme/organisms/home/terminal/HomeTabTerminalBun.vue";
import HomeBeforeFeatures from "@tsed/vitepress-theme/organisms/home/HomeBeforeFeatures.vue";

export default {
extends: DefaultTheme,
Expand All @@ -25,7 +25,7 @@ export default {
bun: () => h(HomeTabTerminalBun)
})
}),
"home-features-before": () => h(HomePartners),
"home-features-before": () => h(HomeBeforeFeatures),
"home-features-after": () => h(HomeBody)
});
}
Expand Down
5 changes: 4 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ hero:
- theme: alt
text: Become sponsor
link: https://github.com/sponsors/Romakita

testimonial:
title: "What is Ts.ED?"
description: Ts.ED is a modern Node.js framework built with TypeScript. It offers a flexible structure with a fast learning curve, specifically designed to improve the developer experience. Ts.ED provides numerous decorators and guidelines to make your code more readable and less error-prone. It supports various platforms and tools, including Node.js/Bun.js, Express.js/Koa.js, CLI, and serverless architectures (e.g., AWS).
features:
- title: Rest API
icon: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"/><rect width="20" height="8" x="2" y="14" rx="2" ry="2"/><line x1="6" x2="6.01" y1="6" y2="6"/><line x1="6" x2="6.01" y1="18" y2="18"/></svg>
Expand Down Expand Up @@ -191,3 +193,4 @@ partners:
---



4 changes: 4 additions & 0 deletions packages/theme/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import HomeFrameworks from "./organisms/home/HomeFrameworks.vue";
import MessageCircleHeart from "./atoms/svg/MessageCircleHeart.vue";
import Warehouse from "./organisms/warehouse/Warehouse.vue";
import Api from "./organisms/api/Api.vue";
import TeamMembers from "./molecules/teams/TeamMembers.vue";
import TeamMembersItem from "./molecules/teams/TeamMembersItem.vue";

export default {
extends: DefaultTheme,
Expand All @@ -27,6 +29,8 @@ export default {
app.component("Projects", Projects);
app.component("HomeFrameworks", HomeFrameworks);
app.component("MessageCircleHeart", MessageCircleHeart);
app.component("TeamMembers", TeamMembers);
app.component("TeamMembersItem", TeamMembersItem);
// eslint-disable-next-line vue/no-reserved-component-names
app.component("Button", Button);
app.component("Banner", Banner);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
export interface Team {
src: string;
title: string;
job: string;
role: string;
github: string;
twitter?: string;
}
export interface CustomThemeConfig {
apiUrl: string;
apiRedirectUrl: string;
repo: string;
team: Team[];
githubProxyUrl: string;
stargazerUrl?: string;
coveragePercentage?: string;
Expand Down
1 change: 0 additions & 1 deletion packages/theme/composables/config/useThemeConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ export function useThemeConfig() {
theme.value.apiUrl = withBase(theme.value?.apiUrl);
}


return theme;
}
69 changes: 69 additions & 0 deletions packages/theme/molecules/teams/TeamMembers.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<script setup lang="ts">
import type {DefaultTheme} from "vitepress/theme";
import {computed} from "vue";
import TeamMembersItem from "./TeamMembersItem.vue";
interface Props {
size?: "small" | "medium";
members: DefaultTheme.TeamMember[];
}
const props = withDefaults(defineProps<Props>(), {
size: "medium"
});
const classes = computed(() => [props.size, `count-${props.members.length}`]);
</script>

<template>
<div class="VPTeamMembers" :class="classes">
<div class="container">
<div v-for="member in members" :key="member.name" class="item">
<TeamMembersItem :size="size" :member="member"/>
</div>
</div>
</div>
</template>

<style scoped>
.VPTeamMembers.small .container {
grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
}
.VPTeamMembers.small.count-1 .container {
max-width: 276px;
}
.VPTeamMembers.small.count-2 .container {
max-width: calc(276px * 2 + 24px);
}
.VPTeamMembers.small.count-3 .container {
max-width: calc(276px * 3 + 24px * 2);
}
.VPTeamMembers.medium .container {
grid-template-columns: repeat(auto-fit, minmax(256px, 1fr));
}
@media (min-width: 375px) {
.VPTeamMembers.medium .container {
grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
}
}
.VPTeamMembers.medium.count-1 .container {
max-width: 368px;
}
.VPTeamMembers.medium.count-2 .container {
max-width: calc(368px * 2 + 24px);
}
.container {
display: grid;
gap: 24px;
margin: 0 auto;
max-width: 1152px;
}
</style>
225 changes: 225 additions & 0 deletions packages/theme/molecules/teams/TeamMembersItem.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
<script setup lang="ts">
import type { DefaultTheme } from 'vitepress/theme'
import VPLink from 'vitepress/dist/client/theme-default/components/VPLink.vue'
import VPSocialLinks from 'vitepress/dist/client/theme-default/components/VPSocialLinks.vue'
interface Props {
size?: 'small' | 'medium'
member: DefaultTheme.TeamMember
}
withDefaults(defineProps<Props>(), {
size: 'medium'
})
</script>

<template>
<article class="VPTeamMembersItem" :class="[size]">
<div class="profile">
<figure class="avatar">
<img class="avatar-img" :src="member.avatar" :alt="member.name" />
</figure>
<div class="data">
<h4 class="name">
{{ member.name }}
</h4>
<p v-if="member.title || member.org" class="affiliation">
<span v-if="member.title" class="title">
{{ member.title }}
</span>
<span v-if="member.title && member.org" class="at"> @ </span>
<VPLink
v-if="member.org"
class="org"
:class="{ link: member.orgLink }"
:href="member.orgLink"
no-icon
>
{{ member.org }}
</VPLink>
</p>
<p v-if="member.desc" class="desc" v-html="member.desc" />
<div v-if="member.links" class="links">
<VPSocialLinks :links="member.links" />
</div>
</div>
</div>
<div v-if="member.sponsor" class="sp">
<VPLink class="sp-link" :href="member.sponsor" no-icon>
<span class="vpi-heart sp-icon" /> {{ member.actionText || 'Sponsor' }}
</VPLink>
</div>
</article>
</template>

<style scoped>
.VPTeamMembersItem {
display: flex;
flex-direction: column;
gap: 2px;
border-radius: 12px;
width: 100%;
height: 100%;
overflow: hidden;
}
.VPTeamMembersItem.small .profile {
padding: 32px;
}
.VPTeamMembersItem.small .data {
padding-top: 20px;
}
.VPTeamMembersItem.small .avatar {
width: 64px;
height: 64px;
}
.VPTeamMembersItem.small .name {
line-height: 24px;
font-size: 16px;
}
.VPTeamMembersItem.small .affiliation {
padding-top: 4px;
line-height: 20px;
font-size: 14px;
}
.VPTeamMembersItem.small .desc {
padding-top: 12px;
line-height: 20px;
font-size: 14px;
}
.VPTeamMembersItem.small .links {
margin: 0 -16px -20px;
padding: 10px 0 0;
}
.VPTeamMembersItem.medium .profile {
padding: 48px 32px;
}
.VPTeamMembersItem.medium .data {
padding-top: 24px;
text-align: center;
}
.VPTeamMembersItem.medium .avatar {
width: 96px;
height: 96px;
}
.VPTeamMembersItem.medium .name {
letter-spacing: 0.15px;
line-height: 28px;
font-size: 20px;
}
.VPTeamMembersItem.medium .affiliation {
padding-top: 4px;
font-size: 16px;
}
.VPTeamMembersItem.medium .desc {
padding-top: 16px;
max-width: 288px;
font-size: 16px;
}
.VPTeamMembersItem.medium .links {
margin: 0 -16px -12px;
padding: 16px 12px 0;
}
.profile {
flex-grow: 1;
background-color: var(--vp-c-bg-soft);
}
.data {
text-align: center;
}
.avatar {
position: relative;
flex-shrink: 0;
margin: 0 auto;
border-radius: 50%;
box-shadow: var(--vp-shadow-3);
}
.avatar-img {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 50%;
object-fit: cover;
}
.name {
margin: 0;
font-weight: 600;
}
.affiliation {
margin: 0;
font-weight: 500;
color: var(--vp-c-text-2);
}
.org.link {
color: var(--vp-c-text-2);
transition: color 0.25s;
}
.org.link:hover {
color: var(--vp-c-brand-1);
}
.desc {
margin: 0 auto;
}
.desc :deep(a) {
font-weight: 500;
color: var(--vp-c-brand-1);
text-decoration-style: dotted;
transition: color 0.25s;
}
.links {
display: flex;
justify-content: center;
height: 56px;
}
.sp-link {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 16px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-sponsor);
background-color: var(--vp-c-bg-soft);
transition: color 0.25s, background-color 0.25s;
}
.sp .sp-link.link:hover,
.sp .sp-link.link:focus {
outline: none;
color: var(--vp-c-white);
background-color: var(--vp-c-sponsor);
}
.sp-icon {
margin-right: 8px;
font-size: 16px;
}
</style>
Loading

0 comments on commit 4c69c19

Please sign in to comment.