From 26e6276b2395075bdcb951e3a365d2975e2fb05e Mon Sep 17 00:00:00 2001 From: sergeyyarkov Date: Wed, 17 Dec 2025 23:25:21 +0300 Subject: [PATCH] added website contacts from directus --- schema.graphql | 22 +++-------- src/components/BaseHead.astro | 66 ++++++++++++++++--------------- src/components/ContactsList.astro | 35 ++++++++++------ src/components/Footer.astro | 13 +++--- src/components/Header.astro | 11 ++++-- src/graphql/gql.ts | 12 ++++++ src/graphql/graphql.ts | 49 +++++++++++++++-------- src/queries/global.ts | 31 +++++++++++++++ 8 files changed, 150 insertions(+), 89 deletions(-) diff --git a/schema.graphql b/schema.graphql index b6582de..a563657 100644 --- a/schema.graphql +++ b/schema.graphql @@ -682,13 +682,13 @@ input create_directus_users_input { } input create_global_input { - email: String - github: String + email: String! + github: String! id: ID ntfy_password: String ntfy_user: String recent_articles_limit: Int - telegram: String + telegram: String! title: String translations: [create_global_translations_input] ym_counter: Int @@ -700,7 +700,6 @@ input create_global_translations_input { global_id: create_global_input id: ID languages_code: create_languages_input - navigation: JSON } input create_home_page_input { @@ -1742,13 +1741,13 @@ type directus_webhooks_mutated { } type global { - email: String - github: String + email: String! + github: String! id: ID! ntfy_password: String ntfy_user: String recent_articles_limit: Int - telegram: String + telegram: String! title: String translations(filter: global_translations_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [global_translations] translations_func: count_functions @@ -1783,8 +1782,6 @@ type global_translations { global_id(filter: global_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): global id: ID! languages_code(filter: languages_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): languages - navigation: JSON - navigation_func: count_functions } type global_translations_aggregated { @@ -1806,7 +1803,6 @@ type global_translations_aggregated_count { global_id: Int id: Int languages_code: Int - navigation: Int } type global_translations_aggregated_fields { @@ -1822,8 +1818,6 @@ input global_translations_filter { global_id: global_filter id: number_filter_operators languages_code: languages_filter - navigation: string_filter_operators - navigation_func: count_function_filter_operators } type global_translations_mutated { @@ -1842,8 +1836,6 @@ input global_translations_quantifier_filter { global_id: global_filter id: number_filter_operators languages_code: languages_filter - navigation: string_filter_operators - navigation_func: count_function_filter_operators } input hash_filter_operators { @@ -2370,7 +2362,6 @@ input update_global_translations_input { global_id: update_global_input id: ID languages_code: update_languages_input - navigation: JSON } input update_home_page_input { @@ -2478,7 +2469,6 @@ type version_global_translations { global_id: JSON id: ID languages_code: JSON - navigation: JSON } type version_home_page { diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index a173eb6..58415d6 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -4,6 +4,7 @@ import siteconfig from "siteconfig.json"; import { SITE_METADATA } from "@root/constants"; import YaMetrika from "./Analytics/YaMetrika.astro"; import { useTranslation } from "@root/i18n/utils"; +import { getSiteSettings } from "../queries"; export interface Props { title?: string; @@ -13,59 +14,60 @@ export interface Props { const canonicalURL = new URL(Astro.url.pathname, Astro.site); const { title, description } = Astro.props; +const siteSettings = await getSiteSettings(); const isDev = import.meta.env.DEV; const t = useTranslation(Astro); --- - - + + - + - - + + {title || SITE_METADATA.title} - - - - - + + + + + - + - - - - - + + + + + - - - {!isDev && siteconfig?.ymCounter && } + + + {!isDev && siteSettings?.ym_counter && } diff --git a/src/components/ContactsList.astro b/src/components/ContactsList.astro index 20060b9..214ae4e 100644 --- a/src/components/ContactsList.astro +++ b/src/components/ContactsList.astro @@ -1,23 +1,32 @@ --- import { Icon } from "astro-icon/components"; +import { getContacts } from "../queries"; + +const contacts = await getContacts(); ---
- Email - - - Github - - - Telegram - - + { + contacts && ( + <> + + Email + + + + Github + + + + Telegram + + + + ) + }
-