feat: add sitemap.xml generation + type definitions + robots.txt update

This commit is contained in:
Web-serfer 2026-05-06 23:41:06 +05:00
parent acf877f325
commit 5af9f8e1ed
5 changed files with 98 additions and 2 deletions

View file

@ -5,6 +5,7 @@
"scripts": {
"dev": "astro dev",
"build": "astro build",
"postbuild": "node scripts/copy-sitemap.mjs",
"preview": "astro preview",
"astro": "astro"
},

View file

@ -8,4 +8,5 @@ Disallow: /email-verified
Disallow: /profile
Disallow: /auth/
Sitemap: https://minivan-berlin.de/sitemap-index.xml
Sitemap: https://minivan-berlin.de/sitemap-index.xml
Sitemap: https://minivan-berlin.de/sitemap.xml

View file

@ -0,0 +1,16 @@
import { cpSync, existsSync } from 'node:fs';
import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const distDir = resolve(__dirname, '..', 'dist', 'client');
const source = resolve(distDir, 'sitemap-0.xml');
const target = resolve(distDir, 'sitemap.xml');
if (existsSync(source)) {
cpSync(source, target);
console.log('✅ sitemap.xml created');
} else {
console.error('❌ sitemap-0.xml not found');
}

12
frontend/src/env.d.ts vendored
View file

@ -12,6 +12,8 @@ interface ImportMetaEnv {
readonly MAIL_PORT: string;
readonly MAIL_FROM: string;
readonly ADMIN_EMAIL: string;
readonly SENDER_EMAIL: string;
readonly PROD: string;
}
interface ImportMeta {
@ -22,6 +24,14 @@ interface ImportMeta {
declare namespace App {
interface Locals {
pb: PocketBase;
user: RecordModel | undefined;
user: RecordModel | null;
}
}
// 3. Расширение window для глобальных функций
declare global {
interface Window {
closeModal?: (modalId: string) => void;
currentSelectedCar?: unknown;
}
}

View file

@ -27,6 +27,37 @@ export interface Car extends BaseRecord {
max_passengers: number;
}
// Интерфейсы для пользователей
export interface User extends BaseRecord {
username: string;
email: string;
name: string;
avatar?: string;
phone?: string;
is_verified: boolean;
emailVisibility?: boolean;
}
// Интерфейсы для бронирований
export interface Booking extends BaseRecord {
customer_name: string;
customer_email: string;
customer_phone: string;
pickup_location: string;
dropoff_location: string;
pickup_date: string;
pickup_time: string;
dropoff_date?: string;
dropoff_time?: string;
passengers: number;
vehicle_id?: string;
vehicle_name?: string;
message?: string;
status: 'pending' | 'confirmed' | 'cancelled' | 'completed';
total_price?: string;
created: string;
}
export interface SliderCar extends BaseRecord {
brand: string;
model: string;
@ -132,6 +163,43 @@ export interface Review extends BaseRecord {
createdAt: string;
}
// Интерфейсы для постов блога
export interface BlogPost extends BaseRecord {
title: string;
slug: string;
excerpt: string;
content: string;
content_html?: string;
image: string;
alt_text?: string;
author: string;
author_name?: string;
author_avatar?: string;
published: boolean;
publish_date: string;
views: number;
tags: string[];
category?: string;
featured: boolean;
}
export type Post = BlogPost;
// Интерфейсы для комментариев блога
export interface Comment extends BaseRecord {
post_id: string;
author_name: string;
author_email: string;
author_avatar?: string;
content: string;
parent_id?: string;
reply_to?: string;
is_verified: boolean;
is_spam: boolean;
is_published: boolean;
created: string;
}
// Интерфейс для отзыва в LatestReviews
export interface LatestReview {
id: string;