update content

This commit is contained in:
Salam-vsem
2025-05-17 15:05:42 +03:00
parent e13a35f1dd
commit 0efc8289ea
15 changed files with 28 additions and 13 deletions

View File

@@ -24,6 +24,7 @@ export const heroSchema = (image: ImageFunction) =>
export const coaches = defineCollection({ export const coaches = defineCollection({
schema: ({ image }) => schema: ({ image }) =>
z.object({ z.object({
order: z.number().optional(),
name: z.string(), name: z.string(),
description: z.string().optional(), description: z.string().optional(),
cover: image(), cover: image(),

View File

@@ -1,11 +1,12 @@
--- ---
cover: './assets/anna-cover.jpeg' order: 2
coverAlt: 'anna' cover: './assets/anna-dmitrienko-cover.jpeg'
name: 'Анна' coverAlt: 'anna-dmitrienko-cover'
name: 'Анна Дмитриенко'
description: 'Спортсмен и тренер. Опыт работы в фитнес индустрии более 10 лет' description: 'Спортсмен и тренер. Опыт работы в фитнес индустрии более 10 лет'
gallery: gallery:
- './assets/anna-slide-1.jpeg' - './assets/anna-dmitrienko-slide-1.jpeg'
- './assets/anna-slide-2.jpeg' - './assets/anna-dmitrienko-slide-2.jpeg'
socialMediaLinks: socialMediaLinks:
- icon: 'instagram' - icon: 'instagram'
href: 'https://www.instagram.com/dmitrienko_a_fit_4you?igsh=MXBpZTVlNHkxOWl6dA==' href: 'https://www.instagram.com/dmitrienko_a_fit_4you?igsh=MXBpZTVlNHkxOWl6dA=='

View File

@@ -1,6 +1,7 @@
--- ---
order: 1
cover: './assets/anna-suleimanova-cover.jpeg' cover: './assets/anna-suleimanova-cover.jpeg'
coverAlt: 'anna-suleimanova' coverAlt: 'anna-suleimanova-cover'
name: 'Александра Сулейманова' name: 'Александра Сулейманова'
description: 'Спортсмен и тренер. Опыт работы в фитнес индустрии 9 лет' description: 'Спортсмен и тренер. Опыт работы в фитнес индустрии 9 лет'
gallery: gallery:

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 215 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@@ -1,10 +1,15 @@
--- ---
order: 0,
cover: './assets/batyr-cover.jpeg' cover: './assets/batyr-cover.jpeg'
coverAlt: 'batyr-suleimanov' coverAlt: 'batyr-suleimanov-cover'
name: 'Батыр Сулейманов' name: 'Батыр Сулейманов'
description: 'Профессиональный выступающий спортсмен и тренер. Опыт работы в фитнес индустрии более 12 лет' description: 'Профессиональный выступающий спортсмен и тренер. Опыт работы в фитнес индустрии более 12 лет'
gallery: gallery:
- './assets/batyr-slide-1.JPG' - './assets/batyr-slide-1.JPG'
- './assets/batyr-slide-2.JPG'
- './assets/batyr-slide-3.JPG'
- './assets/batyr-slide-4.JPG'
- './assets/batyr-slide-5.JPG'
socialMediaLinks: socialMediaLinks:
- icon: 'instagram' - icon: 'instagram'
href: 'https://www.instagram.com/therealbatyr?igsh=MXZkMHdsMDgxM3c4bA%3D%3D&utm_source=qr' href: 'https://www.instagram.com/therealbatyr?igsh=MXZkMHdsMDgxM3c4bA%3D%3D&utm_source=qr'

View File

@@ -2,19 +2,21 @@
import { useTranslations } from '@/i18n/utils' import { useTranslations } from '@/i18n/utils'
import { cn } from '@/libs/cn' import { cn } from '@/libs/cn'
import '@/styles/global.css' import '@/styles/global.css'
import type { TransitionAnimationValue } from 'astro'
import { ClientRouter, slide } from 'astro:transitions' import { ClientRouter, slide } from 'astro:transitions'
type Props = { type Props = {
title: string title: string
bodyClass?: string bodyClass?: string
transition?: TransitionAnimationValue
} }
const { title, bodyClass } = Astro.props const { title, bodyClass, transition } = Astro.props
const t = useTranslations(Astro.currentLocale) const t = useTranslations(Astro.currentLocale)
--- ---
<!doctype html> <!doctype html>
<html lang={Astro.currentLocale} transition:animate={slide({ duration: '0.3s' })}> <html lang={Astro.currentLocale} transition:animate={transition}>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />

View File

@@ -8,7 +8,7 @@ import Header from '@/components/header/Header.astro'
import './styles.css' import './styles.css'
import { SocialMediaIcon } from '@/components/SocialMediaIcon' import { SocialMediaIcon } from '@/components/SocialMediaIcon'
import { useTranslations } from '@/i18n/utils' import { useTranslations } from '@/i18n/utils'
import {slide, ViewTransitions} from 'astro:transitions' import { slide, ViewTransitions } from 'astro:transitions'
export const getStaticPaths = async () => { export const getStaticPaths = async () => {
const coaches = await getCollection('coaches') const coaches = await getCollection('coaches')
@@ -32,7 +32,7 @@ const [thumbs, optimizedGallery] = galleryWithCover
: [undefined, undefined] : [undefined, undefined]
--- ---
<BaseLayout title={data.name}> <BaseLayout title={data.name} transition={slide({ duration: '0.3s' })}>
<Header /> <Header />
{ {
optimizedGallery && ( optimizedGallery && (
@@ -46,7 +46,7 @@ const [thumbs, optimizedGallery] = galleryWithCover
imageClassName="aspect-3/4 w-[400px] lg:w-auto object-top mx-auto h-auto" imageClassName="aspect-3/4 w-[400px] lg:w-auto object-top mx-auto h-auto"
/> />
<div class="flex flex-1 flex-col gap-8"> <div class="flex flex-1 flex-col gap-8">
<h1 class="lg:text-nowrap font-bold">{data.name}</h1> <h1 class="font-bold lg:text-nowrap">{data.name}</h1>
{data.description && <span>{data.description}</span>} {data.description && <span>{data.description}</span>}
<Content /> <Content />
{data.socialMediaLinks && ( {data.socialMediaLinks && (

View File

@@ -20,7 +20,12 @@ import { Coaches } from '@/components/coaches/Coaches'
type Props = CollectionEntry<'pages'>['data'] type Props = CollectionEntry<'pages'>['data']
const { lang } = Astro.params const { lang } = Astro.params
const [page, coaches] = await Promise.all([getEntry('pages', 'main'), getCollection('coaches')]) const [page, coaches] = await Promise.all([
getEntry('pages', 'main'),
getCollection('coaches').then((coaches) =>
coaches.sort((a, b) => (a.data.order ?? -1) - (b.data.order ?? -1))
),
])
const { slider, services, hero, marquee, reviews, footer } = page?.data || {} const { slider, services, hero, marquee, reviews, footer } = page?.data || {}
const optimizedSlider = slider const optimizedSlider = slider
? await optimizeSliderImages(slider.map(({ image, imageAlt }) => ({ src: image, alt: imageAlt }))) ? await optimizeSliderImages(slider.map(({ image, imageAlt }) => ({ src: image, alt: imageAlt })))