diff --git a/src/components/ArchivePagination.astro b/src/components/ArchivePagination.astro
new file mode 100644
index 0000000..080bf77
--- /dev/null
+++ b/src/components/ArchivePagination.astro
@@ -0,0 +1,216 @@
+---
+
+
+interface Props {
+ baseUrl: string;
+ page: number;
+ hasNextPage: boolean;
+ window?: number; // сколько страниц вокруг текущей
+}
+
+const {
+ baseUrl,
+ page,
+ hasNextPage,
+ window = 2,
+} = Astro.props;
+
+const pageUrl = (p: number) =>
+ p === 1 ? baseUrl : `${baseUrl}/page/${p}`;
+
+// рассчитываем диапазон
+const start = Math.max(1, page - window);
+const end = page + window;
+---
+
+
+
+
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
index c5f1e36..ee8d1b5 100644
--- a/src/components/Footer.astro
+++ b/src/components/Footer.astro
@@ -1,4 +1,8 @@
---
+
+import FooterMenu from '@components/FooterMenu.astro';
+
+
interface Props {
publicationName: string;
organization: string;
@@ -90,6 +94,8 @@ const footerId = `footer-profile`;
Правила применения рекомендательных технологий
+
+
diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro
index cbf1533..a3e2372 100644
--- a/src/components/Header/Header.astro
+++ b/src/components/Header/Header.astro
@@ -1,6 +1,7 @@
---
import Stores from './LazyStores.astro';
+ import MainMenu from '@components/MainMenu.astro';
const MENU_ID = 103245;
let menuItems = [];
@@ -14,6 +15,8 @@
+
+
diff --git a/src/lib/api/menu.ts b/src/lib/api/menu.ts
index 1c09103..b3e5c7b 100644
--- a/src/lib/api/menu.ts
+++ b/src/lib/api/menu.ts
@@ -1,71 +1,308 @@
+// lib/api/menu-api.ts
+
import { fetchGraphQL } from './graphql-client.js';
-
-interface MenuItemNode {
- uri: string;
- url: string;
- order: number;
- label: string;
+export interface MenuItem {
+ id: string;
+ databaseId: number;
+ uri: string;
+ url: string;
+ order: number;
+ label: string;
+ parentId: string | null;
+ target: string;
+ cssClasses: string[];
+ description: string;
+ childItems?: {
+ nodes: MenuItem[];
+ };
}
-interface MenuNode {
- name: string;
- menuItems: {
- nodes: MenuItemNode[];
- };
+export interface Menu {
+ id: string;
+ databaseId: number;
+ name: string;
+ slug: string;
+ locations: string[];
+ menuItems: {
+ nodes: MenuItem[];
+ };
}
-interface MenusResponse {
- menus: {
- nodes: MenuNode[];
- };
+export type MenuIdentifier =
+ | { id: number } // По ID меню
+ | { location: string } // По локации
+ | { slug: string } // По слагу
+ | { name: string }; // По имени
+
+/**
+ * Получить меню по идентификатору
+ */
+export async function fetchMenu(identifier: MenuIdentifier): Promise