Skip to content

Commit

Permalink
feat: добавлена интернализация макета «team»(#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegShchavelev committed Oct 8, 2024
1 parent cd8e6a8 commit db379db
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 28 deletions.
68 changes: 51 additions & 17 deletions .vitepress/data/teams.yaml → .vitepress/data/teams.data.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
- avatar: https://avatars.githubusercontent.com/u/2441945?v=4
name: Савченко Андрей
name:
ru: Савченко Андрей
en: Andrew Savchenko
title: bircoph
desc: Релиз-менеджер ALT Mobile
desc:
ru: Релиз-менеджер
en: Release Manager
org: ALT Linux Team
orgLink: https://packages.altlinux.org/ru/sisyphus/maintainers/bircoph/
collaborator:
Expand All @@ -11,9 +15,13 @@
- icon: github
link: https://github.com/bircoph

- name: Быстров Артём
- name:
ru: Быстров Артём
en: Artyom Bystrov
title: arbars
desc: Сопровождающий проекта ALT Mobile
desc:
ru: Сопровождающий
en: Maintainer
org: ALT Linux Team
orgLink: https://packages.altlinux.org/ru/sisyphus/maintainers/arbars/
avatar: https://github.com/Ubuntigroid.png
Expand All @@ -25,25 +33,35 @@
link: https://github.com/Ubuntigroid

- avatar: https://avatars.githubusercontent.com/u/44705058?v=4
name: Политов Антон
name:
ru: Политов Антон
en: Anton Politov
title: ampernic
desc: Фронтенд-разработчик/VitePress/Vuejs, участник ALT Mobile Wiki
desc:
ru: Фронтенд-разработчик/VitePress/Vuejs, участник ALT Mobile Wiki
en: Frontend Developer/VitePress/Vuejs, member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
- icon: github
link: https://github.com/Ampernic

- avatar: https://avatars.githubusercontent.com/u/57626821?v=4
name: Фомченков Семен
desc: Python-разработчик, QA-инженер, участник ALT Mobile Wiki
name:
ru: Фомченков Семен
en: Semen Fomchenkov
desc:
ru: Python-разработчик, QA-инженер, участник ALT Mobile Wiki
en: Python Developer, QA Engineer, member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
- icon: github
link: https://github.com/Armatik

- name: Васьков Владимир
- name:
ru: Васьков Владимир
en: Vladimir Vaskov
title: rirusha
desc: Разработчик Vala/GTK4/libadwaita
avatar: https://github.com/Rirusha.png
Expand All @@ -54,37 +72,53 @@
link: https://github.com/Rirusha

- avatar: https://github.com/X1Z53.png
name: Султаниязов Давид
name:
ru: Султаниязов Давид
en: Sultaniiazov David
title: x1z53
desc: Фронтенд-разработчик/VitePress/Vuejs, участник ALT Mobile Wiki
desc:
ru: Фронтенд-разработчик/VitePress/Vuejs, участник ALT Mobile Wiki
en: Frontend Developer/VitePress/Vuejs, member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
- icon: github
link: https://github.com/X1Z53

- avatar: https://github.com/OlegShchavelev.png
name: Щавелев Олег
name:
ru: Щавелев Олег
en: Oleg Shchavelev
title: olegshchavelev
desc: Фронтенд-разработчик/VitePress/Vuejs, аналитик, участник ALT Mobile Wiki
desc:
ru: Фронтенд-разработчик/VitePress/Vuejs, Cтарший аналитик, участник ALT Mobile Wiki
en: Frontend Developer/VitePress/Vuejs , Senior Analyst ,member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
- icon: github
link: https://github.com/OlegShchavelev

- avatar: https://avatars.githubusercontent.com/u/2198153?v=4
name: Пальгунов Антон
title: Ведущий инженер, участник ALT Mobile Wiki
name:
ru: Пальгунов Антон
en: Anton Palgunov
title: Toxblh
desc: Lead Engineer, member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
- icon: github
link: https://github.com/Toxblh

- avatar: https://avatars.githubusercontent.com/u/36362599?v=4
name: Слипенко Максим
title: Фронтенд-разработчик, участник ALT Mobile Wiki
name:
ru: Слипенко Максим
en: Maxim Slipenko
title: Maks1mS
desc:
ru: Фронтенд-разработчик, участник ALT Mobile Wiki
en: Frontend developer, member of the ALT Mobile Wiki
collaborator:
- knowledge
links:
Expand Down
23 changes: 19 additions & 4 deletions .vitepress/theme/components/AMWTeamMembers.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from '../composables/data'
import { VPTeamPageSection, VPTeamMembers } from 'vitepress/theme'
import { type Collaborator, type AMWTheme } from '../types/index'
import teams from '../../data/teams.yaml'
import teams from '../../data/teams.data.yaml'
const { site } = useData()
const lang = computed(() => site.value.lang.replace('ru-RU', 'ru'))
export interface Member {
title: string
lead?: string
collaborator: Collaborator
name: string | object
size?: 'small' | 'medium'
}
Expand All @@ -23,9 +29,18 @@ defineProps<{
<VPTeamMembers
:size="member.size"
:members="
teams.filter((team) =>
team.collaborator.includes(member.collaborator)
)
teams
.map((team: any) => ({
...team,
name: team.name[lang] ?? team.name,
desc:
typeof team.desc === 'object' && Object.keys(team.desc).length
? team.desc[lang]
: team.desc
}))
.filter((team: any) =>
team.collaborator.includes(member.collaborator)
)
"
/>
</template>
Expand Down
5 changes: 0 additions & 5 deletions .vitepress/theme/components/AMWTeamMembersItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ 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'
const lang = computed(() => {
const { lang } = useData()
return lang
})
interface Props {
size?: 'small' | 'medium'
member: DefaultTheme.TeamMember
Expand Down
22 changes: 20 additions & 2 deletions .vitepress/theme/components/AMWTeams.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from '../composables/data'
import { VPTeamPageTitle, VPTeamMembers, VPButton } from 'vitepress/theme'
import AMWTeamPageAction from './AMWTeamPageAction.vue'
import teams from '../../data/teams.yaml'
import teams from '../../data/teams.data.yaml'
const { site } = useData()
const lang = computed(() => site.value.lang.replace('ru-RU', 'ru'))
defineProps<{
title: string
Expand All @@ -16,7 +21,20 @@ defineProps<{
<template v-if="title" #title> {{ title }} </template>
<template v-if="lead" #lead>{{ lead }}</template>
</VPTeamPageTitle>
<VPTeamMembers :members="teams.slice(0, 6)" />
<VPTeamMembers
:members="
teams
.map((team: any) => ({
...team,
name: team.name[lang] ?? team.name,
desc:
typeof team.desc === 'object' && Object.keys(team.desc).length
? team.desc[lang]
: team.desc
}))
.slice(0, 6)
"
/>
<AMWTeamPageAction>
<template v-if="moreLink" #action>
<VPButton :text="moreText" class="button" size="big" :href="moreLink" />
Expand Down

0 comments on commit db379db

Please sign in to comment.