mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
added website contacts from directus
This commit is contained in:
parent
c371e3dba4
commit
26e6276b23
@ -682,13 +682,13 @@ input create_directus_users_input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input create_global_input {
|
input create_global_input {
|
||||||
email: String
|
email: String!
|
||||||
github: String
|
github: String!
|
||||||
id: ID
|
id: ID
|
||||||
ntfy_password: String
|
ntfy_password: String
|
||||||
ntfy_user: String
|
ntfy_user: String
|
||||||
recent_articles_limit: Int
|
recent_articles_limit: Int
|
||||||
telegram: String
|
telegram: String!
|
||||||
title: String
|
title: String
|
||||||
translations: [create_global_translations_input]
|
translations: [create_global_translations_input]
|
||||||
ym_counter: Int
|
ym_counter: Int
|
||||||
@ -700,7 +700,6 @@ input create_global_translations_input {
|
|||||||
global_id: create_global_input
|
global_id: create_global_input
|
||||||
id: ID
|
id: ID
|
||||||
languages_code: create_languages_input
|
languages_code: create_languages_input
|
||||||
navigation: JSON
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input create_home_page_input {
|
input create_home_page_input {
|
||||||
@ -1742,13 +1741,13 @@ type directus_webhooks_mutated {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type global {
|
type global {
|
||||||
email: String
|
email: String!
|
||||||
github: String
|
github: String!
|
||||||
id: ID!
|
id: ID!
|
||||||
ntfy_password: String
|
ntfy_password: String
|
||||||
ntfy_user: String
|
ntfy_user: String
|
||||||
recent_articles_limit: Int
|
recent_articles_limit: Int
|
||||||
telegram: String
|
telegram: String!
|
||||||
title: String
|
title: String
|
||||||
translations(filter: global_translations_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [global_translations]
|
translations(filter: global_translations_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): [global_translations]
|
||||||
translations_func: count_functions
|
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
|
global_id(filter: global_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): global
|
||||||
id: ID!
|
id: ID!
|
||||||
languages_code(filter: languages_filter, limit: Int, offset: Int, page: Int, search: String, sort: [String]): languages
|
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 {
|
type global_translations_aggregated {
|
||||||
@ -1806,7 +1803,6 @@ type global_translations_aggregated_count {
|
|||||||
global_id: Int
|
global_id: Int
|
||||||
id: Int
|
id: Int
|
||||||
languages_code: Int
|
languages_code: Int
|
||||||
navigation: Int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type global_translations_aggregated_fields {
|
type global_translations_aggregated_fields {
|
||||||
@ -1822,8 +1818,6 @@ input global_translations_filter {
|
|||||||
global_id: global_filter
|
global_id: global_filter
|
||||||
id: number_filter_operators
|
id: number_filter_operators
|
||||||
languages_code: languages_filter
|
languages_code: languages_filter
|
||||||
navigation: string_filter_operators
|
|
||||||
navigation_func: count_function_filter_operators
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type global_translations_mutated {
|
type global_translations_mutated {
|
||||||
@ -1842,8 +1836,6 @@ input global_translations_quantifier_filter {
|
|||||||
global_id: global_filter
|
global_id: global_filter
|
||||||
id: number_filter_operators
|
id: number_filter_operators
|
||||||
languages_code: languages_filter
|
languages_code: languages_filter
|
||||||
navigation: string_filter_operators
|
|
||||||
navigation_func: count_function_filter_operators
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input hash_filter_operators {
|
input hash_filter_operators {
|
||||||
@ -2370,7 +2362,6 @@ input update_global_translations_input {
|
|||||||
global_id: update_global_input
|
global_id: update_global_input
|
||||||
id: ID
|
id: ID
|
||||||
languages_code: update_languages_input
|
languages_code: update_languages_input
|
||||||
navigation: JSON
|
|
||||||
}
|
}
|
||||||
|
|
||||||
input update_home_page_input {
|
input update_home_page_input {
|
||||||
@ -2478,7 +2469,6 @@ type version_global_translations {
|
|||||||
global_id: JSON
|
global_id: JSON
|
||||||
id: ID
|
id: ID
|
||||||
languages_code: JSON
|
languages_code: JSON
|
||||||
navigation: JSON
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type version_home_page {
|
type version_home_page {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import siteconfig from "siteconfig.json";
|
|||||||
import { SITE_METADATA } from "@root/constants";
|
import { SITE_METADATA } from "@root/constants";
|
||||||
import YaMetrika from "./Analytics/YaMetrika.astro";
|
import YaMetrika from "./Analytics/YaMetrika.astro";
|
||||||
import { useTranslation } from "@root/i18n/utils";
|
import { useTranslation } from "@root/i18n/utils";
|
||||||
|
import { getSiteSettings } from "../queries";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
title?: string;
|
title?: string;
|
||||||
@ -13,59 +14,60 @@ export interface Props {
|
|||||||
|
|
||||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||||
const { title, description } = Astro.props;
|
const { title, description } = Astro.props;
|
||||||
|
const siteSettings = await getSiteSettings();
|
||||||
const isDev = import.meta.env.DEV;
|
const isDev = import.meta.env.DEV;
|
||||||
const t = useTranslation(Astro);
|
const t = useTranslation(Astro);
|
||||||
---
|
---
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel='preconnect' href='https://fonts.googleapis.com' />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel='preconnect' href='https://fonts.gstatic.com' crossorigin />
|
||||||
<link
|
<link
|
||||||
href="https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono&display=swap"
|
href='https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono&display=swap'
|
||||||
rel="preload"
|
rel='preload'
|
||||||
as="style"
|
as='style'
|
||||||
onload="this.rel='stylesheet'"
|
onload="this.rel='stylesheet'"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Canonical URL -->
|
<!-- Canonical URL -->
|
||||||
<link rel="canonical" href={canonicalURL.href} />
|
<link rel='canonical' href={canonicalURL.href} />
|
||||||
|
|
||||||
<!-- Base metadata -->
|
<!-- Base metadata -->
|
||||||
<meta charset="utf-8" />
|
<meta charset='utf-8' />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
||||||
<title>{title || SITE_METADATA.title}</title>
|
<title>{title || SITE_METADATA.title}</title>
|
||||||
|
|
||||||
<!-- Metadata -->
|
<!-- Metadata -->
|
||||||
<meta name="title" content={title || SITE_METADATA.title} />
|
<meta name='title' content={title || SITE_METADATA.title} />
|
||||||
<meta name="generator" content={Astro.generator} />
|
<meta name='generator' content={Astro.generator} />
|
||||||
<meta name="description" content={description || t("site.description")} />
|
<meta name='description' content={description || t("site.description")} />
|
||||||
<meta name="theme-color" content={SITE_METADATA.themeColor} />
|
<meta name='theme-color' content={SITE_METADATA.themeColor} />
|
||||||
<meta name="msapplication-TileColor" content="#da532c" />
|
<meta name='msapplication-TileColor' content='#da532c' />
|
||||||
|
|
||||||
<!-- Favicons -->
|
<!-- Favicons -->
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
<link rel='apple-touch-icon' sizes='180x180' href='/apple-touch-icon.png' />
|
||||||
<link
|
<link
|
||||||
rel="icon"
|
rel='icon'
|
||||||
type="image/png"
|
type='image/png'
|
||||||
sizes="32x32"
|
sizes='32x32'
|
||||||
href="/favicon-light-32x32.png"
|
href='/favicon-light-32x32.png'
|
||||||
media="(prefers-color-scheme: light)"
|
media='(prefers-color-scheme: light)'
|
||||||
/>
|
/>
|
||||||
<link
|
<link
|
||||||
rel="icon"
|
rel='icon'
|
||||||
type="image/png"
|
type='image/png'
|
||||||
sizes="16x16"
|
sizes='16x16'
|
||||||
href="/favicon-light-16x16.png"
|
href='/favicon-light-16x16.png'
|
||||||
media="(prefers-color-scheme: light)"
|
media='(prefers-color-scheme: light)'
|
||||||
/>
|
/>
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-dark-32x32.png" media="(prefers-color-scheme: dark)" />
|
<link rel='icon' type='image/png' sizes='32x32' href='/favicon-dark-32x32.png' media='(prefers-color-scheme: dark)' />
|
||||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-dark-16x16.png" media="(prefers-color-scheme: dark)" />
|
<link rel='icon' type='image/png' sizes='16x16' href='/favicon-dark-16x16.png' media='(prefers-color-scheme: dark)' />
|
||||||
<link rel="manifest" href="/site.webmanifest" />
|
<link rel='manifest' href='/site.webmanifest' />
|
||||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
<link rel='mask-icon' href='/safari-pinned-tab.svg' color='#5bbad5' />
|
||||||
<link rel="sitemap" href="/sitemap-index.xml" />
|
<link rel='sitemap' href='/sitemap-index.xml' />
|
||||||
<slot />
|
<slot />
|
||||||
<script is:inline src="/assets/js/detect-theme.js"></script>
|
<script is:inline src='/assets/js/detect-theme.js'></script>
|
||||||
<script src="../quicklink.js"></script>
|
<script src='../quicklink.js'></script>
|
||||||
{!isDev && siteconfig?.ymCounter && <YaMetrika counter={siteconfig.ymCounter} />}
|
{!isDev && siteSettings?.ym_counter && <YaMetrika counter={siteSettings.ym_counter} />}
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@ -1,23 +1,32 @@
|
|||||||
---
|
---
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
|
import { getContacts } from "../queries";
|
||||||
|
|
||||||
|
const contacts = await getContacts();
|
||||||
---
|
---
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href={"mailto:" + "serzh.yarkov@gmail.com"}
|
{
|
||||||
>Email
|
contacts && (
|
||||||
<Icon name="arrow-up-right" width="15" height="15" data-filter="none" />
|
<>
|
||||||
|
<a href={"mailto:" + contacts.email}>
|
||||||
|
Email
|
||||||
|
<Icon name='arrow-up-right' width='15' height='15' data-filter='none' />
|
||||||
</a>
|
</a>
|
||||||
<a href={"https://github.com/sergeyyarkov"} target="_blank"
|
<a href={contacts.github} target='_blank'>
|
||||||
>Github
|
Github
|
||||||
<Icon name="arrow-up-right" width="15" height="15" data-filter="none" />
|
<Icon name='arrow-up-right' width='15' height='15' data-filter='none' />
|
||||||
</a>
|
</a>
|
||||||
<a href={"https://t.me/sergeyyarkov"} target="_blank"
|
<a href={contacts.telegram} target='_blank'>
|
||||||
>Telegram
|
Telegram
|
||||||
<Icon name="arrow-up-right" width="15" height="15" data-filter="none" />
|
<Icon name='arrow-up-right' width='15' height='15' data-filter='none' />
|
||||||
</a>
|
</a>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang='scss'>
|
||||||
div {
|
div {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|||||||
@ -1,30 +1,27 @@
|
|||||||
---
|
---
|
||||||
import { SITE_METADATA } from "@root/constants";
|
|
||||||
import { Icon } from "astro-icon/components";
|
import { Icon } from "astro-icon/components";
|
||||||
import TranslatedLink from "./TranslatedLink.astro";
|
import TranslatedLink from "./TranslatedLink.astro";
|
||||||
import UIString from "./UIString.astro";
|
import UIString from "./UIString.astro";
|
||||||
---
|
---
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<div class="container">
|
<div class='container'>
|
||||||
<div>
|
<div>
|
||||||
<i>
|
<i>
|
||||||
<UIString key={"footer.developed"} />: <TranslatedLink to="/contacts/">
|
<UIString key={"footer.developed"} />: <TranslatedLink to='/contacts/'> Sergey Yarkov </TranslatedLink>
|
||||||
{SITE_METADATA.author}
|
|
||||||
</TranslatedLink>
|
|
||||||
© {new Date().getFullYear()}
|
© {new Date().getFullYear()}
|
||||||
</i>
|
</i>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<a href="/rss.xml" target="_blank"><UIString key={"footer.rssFeed"} /></a>
|
<a href='/rss.xml' target='_blank'><UIString key={"footer.rssFeed"} /></a>
|
||||||
<span>
|
<span>
|
||||||
<Icon name="rss" width="20" height="20" />
|
<Icon name='rss' width='20' height='20' />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang='scss'>
|
||||||
footer {
|
footer {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
margin-top: 5rem;
|
margin-top: 5rem;
|
||||||
|
|||||||
@ -6,6 +6,9 @@ import LanguageSelect from "@components/LanguageSelect.astro";
|
|||||||
import NavToggle from "@components/NavToggle";
|
import NavToggle from "@components/NavToggle";
|
||||||
import UIString from "@components/UIString.astro";
|
import UIString from "@components/UIString.astro";
|
||||||
import TranslatedLink from "@components/TranslatedLink.astro";
|
import TranslatedLink from "@components/TranslatedLink.astro";
|
||||||
|
import { getContacts } from "../queries";
|
||||||
|
|
||||||
|
const contacts = await getContacts();
|
||||||
---
|
---
|
||||||
|
|
||||||
<header {...IS_SITE_UNDER_CONSTRUCTION ? { style: "top: 45px;" } : {}}>
|
<header {...IS_SITE_UNDER_CONSTRUCTION ? { style: "top: 45px;" } : {}}>
|
||||||
@ -31,17 +34,17 @@ import TranslatedLink from "@components/TranslatedLink.astro";
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
{
|
{
|
||||||
SITE_METADATA.contacts && (
|
contacts && (
|
||||||
<div class='contacts'>
|
<div class='contacts'>
|
||||||
<a target='_blank' href={"mailto:" + SITE_METADATA.contacts.email}>
|
<a target='_blank' href={"mailto:" + contacts.email}>
|
||||||
Email
|
Email
|
||||||
<Icon name='email' width='18' height='18' />
|
<Icon name='email' width='18' height='18' />
|
||||||
</a>
|
</a>
|
||||||
<a target='_blank' href={SITE_METADATA.contacts.github}>
|
<a target='_blank' href={contacts.github}>
|
||||||
Github
|
Github
|
||||||
<Icon name='github_filled' width='18' height='18' />
|
<Icon name='github_filled' width='18' height='18' />
|
||||||
</a>
|
</a>
|
||||||
<a target='_blank' href={SITE_METADATA.contacts.telegram}>
|
<a target='_blank' href={contacts.telegram}>
|
||||||
Telegram
|
Telegram
|
||||||
<Icon name='telegram' width='18' height='18' />
|
<Icon name='telegram' width='18' height='18' />
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -20,6 +20,8 @@ type Documents = {
|
|||||||
"\n\t\tquery Article_translations($slug: String!) {\n\t\t\tarticle_translations(filter: { slug: { _eq: $slug } }) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\ttags {\n\t\t\t\t\ttag_id {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdescription\n\t\t\t\tslug\n\t\t\t\tcontent\n\t\t\t\tauthor {\n\t\t\t\t\tfirst_name\n\t\t\t\t\tlast_name\n\t\t\t\t}\n\t\t\t\tpub_date\n\t\t\t\tviews\n\t\t\t\tlanguages_code {\n\t\t\t\t\tcode\n\t\t\t\t\tname\n\t\t\t\t}\n\t\t\t\tcover_image {\n\t\t\t\t\ttitle\n\t\t\t\t\ttype\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t\tarticle_id {\n\t\t\t\t\ttranslations {\n\t\t\t\t\t\tslug\n\t\t\t\t\t\tlanguages_code {\n\t\t\t\t\t\t\tcode\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpub_date\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": typeof types.Article_TranslationsDocument,
|
"\n\t\tquery Article_translations($slug: String!) {\n\t\t\tarticle_translations(filter: { slug: { _eq: $slug } }) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\ttags {\n\t\t\t\t\ttag_id {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdescription\n\t\t\t\tslug\n\t\t\t\tcontent\n\t\t\t\tauthor {\n\t\t\t\t\tfirst_name\n\t\t\t\t\tlast_name\n\t\t\t\t}\n\t\t\t\tpub_date\n\t\t\t\tviews\n\t\t\t\tlanguages_code {\n\t\t\t\t\tcode\n\t\t\t\t\tname\n\t\t\t\t}\n\t\t\t\tcover_image {\n\t\t\t\t\ttitle\n\t\t\t\t\ttype\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t\tarticle_id {\n\t\t\t\t\ttranslations {\n\t\t\t\t\t\tslug\n\t\t\t\t\t\tlanguages_code {\n\t\t\t\t\t\t\tcode\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpub_date\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": typeof types.Article_TranslationsDocument,
|
||||||
"\n\t\tmutation Update_article_translations_item($id: ID!, $views: Int!) {\n\t\t\tupdate_article_translations_item(id: $id, data: { views: $views }) {\n\t\t\t\tviews\n\t\t\t}\n\t\t}\n\t": typeof types.Update_Article_Translations_ItemDocument,
|
"\n\t\tmutation Update_article_translations_item($id: ID!, $views: Int!) {\n\t\t\tupdate_article_translations_item(id: $id, data: { views: $views }) {\n\t\t\t\tviews\n\t\t\t}\n\t\t}\n\t": typeof types.Update_Article_Translations_ItemDocument,
|
||||||
"\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t": typeof types.AboutMeQueryDocument,
|
"\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t": typeof types.AboutMeQueryDocument,
|
||||||
|
"\n\t\tquery ContactsQuery {\n\t\t\tglobal {\n\t\t\t\temail\n\t\t\t\tgithub\n\t\t\t\ttelegram\n\t\t\t}\n\t\t}\n\t": typeof types.ContactsQueryDocument,
|
||||||
|
"\n\t\tquery SiteSettingsQuery {\n\t\t\tglobal {\n\t\t\t\tym_counter\n\t\t\t\trecent_articles_limit\n\t\t\t}\n\t\t}\n\t": typeof types.SiteSettingsQueryDocument,
|
||||||
"\n\t\tquery Project_translations($pageLang: String!) {\n\t\t\tproject_translations(filter: { languages_code: { code: { _contains: $pageLang } } }, sort: [\"-year\"]) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\tyear\n\t\t\t\tdescription\n\t\t\t\tsource_url\n\t\t\t\tdemo_url\n\t\t\t\tarticle_url\n\t\t\t\ticon {\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": typeof types.Project_TranslationsDocument,
|
"\n\t\tquery Project_translations($pageLang: String!) {\n\t\t\tproject_translations(filter: { languages_code: { code: { _contains: $pageLang } } }, sort: [\"-year\"]) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\tyear\n\t\t\t\tdescription\n\t\t\t\tsource_url\n\t\t\t\tdemo_url\n\t\t\t\tarticle_url\n\t\t\t\ticon {\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": typeof types.Project_TranslationsDocument,
|
||||||
"\n\t\tquery Tag {\n\t\t\ttag {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t}\n\t\t}\n\t": typeof types.TagDocument,
|
"\n\t\tquery Tag {\n\t\t\ttag {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t}\n\t\t}\n\t": typeof types.TagDocument,
|
||||||
};
|
};
|
||||||
@ -29,6 +31,8 @@ const documents: Documents = {
|
|||||||
"\n\t\tquery Article_translations($slug: String!) {\n\t\t\tarticle_translations(filter: { slug: { _eq: $slug } }) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\ttags {\n\t\t\t\t\ttag_id {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdescription\n\t\t\t\tslug\n\t\t\t\tcontent\n\t\t\t\tauthor {\n\t\t\t\t\tfirst_name\n\t\t\t\t\tlast_name\n\t\t\t\t}\n\t\t\t\tpub_date\n\t\t\t\tviews\n\t\t\t\tlanguages_code {\n\t\t\t\t\tcode\n\t\t\t\t\tname\n\t\t\t\t}\n\t\t\t\tcover_image {\n\t\t\t\t\ttitle\n\t\t\t\t\ttype\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t\tarticle_id {\n\t\t\t\t\ttranslations {\n\t\t\t\t\t\tslug\n\t\t\t\t\t\tlanguages_code {\n\t\t\t\t\t\t\tcode\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpub_date\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.Article_TranslationsDocument,
|
"\n\t\tquery Article_translations($slug: String!) {\n\t\t\tarticle_translations(filter: { slug: { _eq: $slug } }) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\ttags {\n\t\t\t\t\ttag_id {\n\t\t\t\t\t\ttitle\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tdescription\n\t\t\t\tslug\n\t\t\t\tcontent\n\t\t\t\tauthor {\n\t\t\t\t\tfirst_name\n\t\t\t\t\tlast_name\n\t\t\t\t}\n\t\t\t\tpub_date\n\t\t\t\tviews\n\t\t\t\tlanguages_code {\n\t\t\t\t\tcode\n\t\t\t\t\tname\n\t\t\t\t}\n\t\t\t\tcover_image {\n\t\t\t\t\ttitle\n\t\t\t\t\ttype\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t\tarticle_id {\n\t\t\t\t\ttranslations {\n\t\t\t\t\t\tslug\n\t\t\t\t\t\tlanguages_code {\n\t\t\t\t\t\t\tcode\n\t\t\t\t\t\t\tname\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpub_date\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.Article_TranslationsDocument,
|
||||||
"\n\t\tmutation Update_article_translations_item($id: ID!, $views: Int!) {\n\t\t\tupdate_article_translations_item(id: $id, data: { views: $views }) {\n\t\t\t\tviews\n\t\t\t}\n\t\t}\n\t": types.Update_Article_Translations_ItemDocument,
|
"\n\t\tmutation Update_article_translations_item($id: ID!, $views: Int!) {\n\t\t\tupdate_article_translations_item(id: $id, data: { views: $views }) {\n\t\t\t\tviews\n\t\t\t}\n\t\t}\n\t": types.Update_Article_Translations_ItemDocument,
|
||||||
"\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t": types.AboutMeQueryDocument,
|
"\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t": types.AboutMeQueryDocument,
|
||||||
|
"\n\t\tquery ContactsQuery {\n\t\t\tglobal {\n\t\t\t\temail\n\t\t\t\tgithub\n\t\t\t\ttelegram\n\t\t\t}\n\t\t}\n\t": types.ContactsQueryDocument,
|
||||||
|
"\n\t\tquery SiteSettingsQuery {\n\t\t\tglobal {\n\t\t\t\tym_counter\n\t\t\t\trecent_articles_limit\n\t\t\t}\n\t\t}\n\t": types.SiteSettingsQueryDocument,
|
||||||
"\n\t\tquery Project_translations($pageLang: String!) {\n\t\t\tproject_translations(filter: { languages_code: { code: { _contains: $pageLang } } }, sort: [\"-year\"]) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\tyear\n\t\t\t\tdescription\n\t\t\t\tsource_url\n\t\t\t\tdemo_url\n\t\t\t\tarticle_url\n\t\t\t\ticon {\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.Project_TranslationsDocument,
|
"\n\t\tquery Project_translations($pageLang: String!) {\n\t\t\tproject_translations(filter: { languages_code: { code: { _contains: $pageLang } } }, sort: [\"-year\"]) {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t\tyear\n\t\t\t\tdescription\n\t\t\t\tsource_url\n\t\t\t\tdemo_url\n\t\t\t\tarticle_url\n\t\t\t\ticon {\n\t\t\t\t\tfilename_disk\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t": types.Project_TranslationsDocument,
|
||||||
"\n\t\tquery Tag {\n\t\t\ttag {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t}\n\t\t}\n\t": types.TagDocument,
|
"\n\t\tquery Tag {\n\t\t\ttag {\n\t\t\t\tid\n\t\t\t\ttitle\n\t\t\t}\n\t\t}\n\t": types.TagDocument,
|
||||||
};
|
};
|
||||||
@ -53,6 +57,14 @@ export function graphql(source: "\n\t\tmutation Update_article_translations_item
|
|||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
export function graphql(source: "\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t"): typeof import('./graphql').AboutMeQueryDocument;
|
export function graphql(source: "\n\t\tquery AboutMeQuery($pageLang: String!) {\n\t\t\tglobal_translations(filter: { languages_code: { code: { _contains: $pageLang } } }) {\n\t\t\t\tabout\n\t\t\t}\n\t\t}\n\t"): typeof import('./graphql').AboutMeQueryDocument;
|
||||||
|
/**
|
||||||
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
|
*/
|
||||||
|
export function graphql(source: "\n\t\tquery ContactsQuery {\n\t\t\tglobal {\n\t\t\t\temail\n\t\t\t\tgithub\n\t\t\t\ttelegram\n\t\t\t}\n\t\t}\n\t"): typeof import('./graphql').ContactsQueryDocument;
|
||||||
|
/**
|
||||||
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
|
*/
|
||||||
|
export function graphql(source: "\n\t\tquery SiteSettingsQuery {\n\t\t\tglobal {\n\t\t\t\tym_counter\n\t\t\t\trecent_articles_limit\n\t\t\t}\n\t\t}\n\t"): typeof import('./graphql').SiteSettingsQueryDocument;
|
||||||
/**
|
/**
|
||||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1984,13 +1984,13 @@ export type Create_Directus_Users_Input = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type Create_Global_Input = {
|
export type Create_Global_Input = {
|
||||||
email?: InputMaybe<Scalars['String']['input']>;
|
email: Scalars['String']['input'];
|
||||||
github?: InputMaybe<Scalars['String']['input']>;
|
github: Scalars['String']['input'];
|
||||||
id?: InputMaybe<Scalars['ID']['input']>;
|
id?: InputMaybe<Scalars['ID']['input']>;
|
||||||
ntfy_password?: InputMaybe<Scalars['String']['input']>;
|
ntfy_password?: InputMaybe<Scalars['String']['input']>;
|
||||||
ntfy_user?: InputMaybe<Scalars['String']['input']>;
|
ntfy_user?: InputMaybe<Scalars['String']['input']>;
|
||||||
recent_articles_limit?: InputMaybe<Scalars['Int']['input']>;
|
recent_articles_limit?: InputMaybe<Scalars['Int']['input']>;
|
||||||
telegram?: InputMaybe<Scalars['String']['input']>;
|
telegram: Scalars['String']['input'];
|
||||||
title?: InputMaybe<Scalars['String']['input']>;
|
title?: InputMaybe<Scalars['String']['input']>;
|
||||||
translations?: InputMaybe<Array<InputMaybe<Create_Global_Translations_Input>>>;
|
translations?: InputMaybe<Array<InputMaybe<Create_Global_Translations_Input>>>;
|
||||||
ym_counter?: InputMaybe<Scalars['Int']['input']>;
|
ym_counter?: InputMaybe<Scalars['Int']['input']>;
|
||||||
@ -2002,7 +2002,6 @@ export type Create_Global_Translations_Input = {
|
|||||||
global_id?: InputMaybe<Create_Global_Input>;
|
global_id?: InputMaybe<Create_Global_Input>;
|
||||||
id?: InputMaybe<Scalars['ID']['input']>;
|
id?: InputMaybe<Scalars['ID']['input']>;
|
||||||
languages_code?: InputMaybe<Create_Languages_Input>;
|
languages_code?: InputMaybe<Create_Languages_Input>;
|
||||||
navigation?: InputMaybe<Scalars['JSON']['input']>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Create_Home_Page_Input = {
|
export type Create_Home_Page_Input = {
|
||||||
@ -3600,13 +3599,13 @@ export type Directus_Webhooks_Mutated = {
|
|||||||
|
|
||||||
export type Global = {
|
export type Global = {
|
||||||
__typename?: 'global';
|
__typename?: 'global';
|
||||||
email?: Maybe<Scalars['String']['output']>;
|
email: Scalars['String']['output'];
|
||||||
github?: Maybe<Scalars['String']['output']>;
|
github: Scalars['String']['output'];
|
||||||
id: Scalars['ID']['output'];
|
id: Scalars['ID']['output'];
|
||||||
ntfy_password?: Maybe<Scalars['String']['output']>;
|
ntfy_password?: Maybe<Scalars['String']['output']>;
|
||||||
ntfy_user?: Maybe<Scalars['String']['output']>;
|
ntfy_user?: Maybe<Scalars['String']['output']>;
|
||||||
recent_articles_limit?: Maybe<Scalars['Int']['output']>;
|
recent_articles_limit?: Maybe<Scalars['Int']['output']>;
|
||||||
telegram?: Maybe<Scalars['String']['output']>;
|
telegram: Scalars['String']['output'];
|
||||||
title?: Maybe<Scalars['String']['output']>;
|
title?: Maybe<Scalars['String']['output']>;
|
||||||
translations?: Maybe<Array<Maybe<Global_Translations>>>;
|
translations?: Maybe<Array<Maybe<Global_Translations>>>;
|
||||||
translations_func?: Maybe<Count_Functions>;
|
translations_func?: Maybe<Count_Functions>;
|
||||||
@ -3653,8 +3652,6 @@ export type Global_Translations = {
|
|||||||
global_id?: Maybe<Global>;
|
global_id?: Maybe<Global>;
|
||||||
id: Scalars['ID']['output'];
|
id: Scalars['ID']['output'];
|
||||||
languages_code?: Maybe<Languages>;
|
languages_code?: Maybe<Languages>;
|
||||||
navigation?: Maybe<Scalars['JSON']['output']>;
|
|
||||||
navigation_func?: Maybe<Count_Functions>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -3698,7 +3695,6 @@ export type Global_Translations_Aggregated_Count = {
|
|||||||
global_id?: Maybe<Scalars['Int']['output']>;
|
global_id?: Maybe<Scalars['Int']['output']>;
|
||||||
id?: Maybe<Scalars['Int']['output']>;
|
id?: Maybe<Scalars['Int']['output']>;
|
||||||
languages_code?: Maybe<Scalars['Int']['output']>;
|
languages_code?: Maybe<Scalars['Int']['output']>;
|
||||||
navigation?: Maybe<Scalars['Int']['output']>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Global_Translations_Aggregated_Fields = {
|
export type Global_Translations_Aggregated_Fields = {
|
||||||
@ -3715,8 +3711,6 @@ export type Global_Translations_Filter = {
|
|||||||
global_id?: InputMaybe<Global_Filter>;
|
global_id?: InputMaybe<Global_Filter>;
|
||||||
id?: InputMaybe<Number_Filter_Operators>;
|
id?: InputMaybe<Number_Filter_Operators>;
|
||||||
languages_code?: InputMaybe<Languages_Filter>;
|
languages_code?: InputMaybe<Languages_Filter>;
|
||||||
navigation?: InputMaybe<String_Filter_Operators>;
|
|
||||||
navigation_func?: InputMaybe<Count_Function_Filter_Operators>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Global_Translations_Mutated = {
|
export type Global_Translations_Mutated = {
|
||||||
@ -3736,8 +3730,6 @@ export type Global_Translations_Quantifier_Filter = {
|
|||||||
global_id?: InputMaybe<Global_Filter>;
|
global_id?: InputMaybe<Global_Filter>;
|
||||||
id?: InputMaybe<Number_Filter_Operators>;
|
id?: InputMaybe<Number_Filter_Operators>;
|
||||||
languages_code?: InputMaybe<Languages_Filter>;
|
languages_code?: InputMaybe<Languages_Filter>;
|
||||||
navigation?: InputMaybe<String_Filter_Operators>;
|
|
||||||
navigation_func?: InputMaybe<Count_Function_Filter_Operators>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Hash_Filter_Operators = {
|
export type Hash_Filter_Operators = {
|
||||||
@ -4360,7 +4352,6 @@ export type Update_Global_Translations_Input = {
|
|||||||
global_id?: InputMaybe<Update_Global_Input>;
|
global_id?: InputMaybe<Update_Global_Input>;
|
||||||
id?: InputMaybe<Scalars['ID']['input']>;
|
id?: InputMaybe<Scalars['ID']['input']>;
|
||||||
languages_code?: InputMaybe<Update_Languages_Input>;
|
languages_code?: InputMaybe<Update_Languages_Input>;
|
||||||
navigation?: InputMaybe<Scalars['JSON']['input']>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Update_Home_Page_Input = {
|
export type Update_Home_Page_Input = {
|
||||||
@ -4475,7 +4466,6 @@ export type Version_Global_Translations = {
|
|||||||
global_id?: Maybe<Scalars['JSON']['output']>;
|
global_id?: Maybe<Scalars['JSON']['output']>;
|
||||||
id?: Maybe<Scalars['ID']['output']>;
|
id?: Maybe<Scalars['ID']['output']>;
|
||||||
languages_code?: Maybe<Scalars['JSON']['output']>;
|
languages_code?: Maybe<Scalars['JSON']['output']>;
|
||||||
navigation?: Maybe<Scalars['JSON']['output']>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Version_Home_Page = {
|
export type Version_Home_Page = {
|
||||||
@ -4559,6 +4549,16 @@ export type AboutMeQueryQueryVariables = Exact<{
|
|||||||
|
|
||||||
export type AboutMeQueryQuery = { __typename?: 'Query', global_translations: Array<{ __typename?: 'global_translations', about?: string | null }> };
|
export type AboutMeQueryQuery = { __typename?: 'Query', global_translations: Array<{ __typename?: 'global_translations', about?: string | null }> };
|
||||||
|
|
||||||
|
export type ContactsQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type ContactsQueryQuery = { __typename?: 'Query', global?: { __typename?: 'global', email: string, github: string, telegram: string } | null };
|
||||||
|
|
||||||
|
export type SiteSettingsQueryQueryVariables = Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
|
export type SiteSettingsQueryQuery = { __typename?: 'Query', global?: { __typename?: 'global', ym_counter?: number | null, recent_articles_limit?: number | null } | null };
|
||||||
|
|
||||||
export type Project_TranslationsQueryVariables = Exact<{
|
export type Project_TranslationsQueryVariables = Exact<{
|
||||||
pageLang: Scalars['String']['input'];
|
pageLang: Scalars['String']['input'];
|
||||||
}>;
|
}>;
|
||||||
@ -4686,6 +4686,23 @@ export const AboutMeQueryDocument = new TypedDocumentString(`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`) as unknown as TypedDocumentString<AboutMeQueryQuery, AboutMeQueryQueryVariables>;
|
`) as unknown as TypedDocumentString<AboutMeQueryQuery, AboutMeQueryQueryVariables>;
|
||||||
|
export const ContactsQueryDocument = new TypedDocumentString(`
|
||||||
|
query ContactsQuery {
|
||||||
|
global {
|
||||||
|
email
|
||||||
|
github
|
||||||
|
telegram
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`) as unknown as TypedDocumentString<ContactsQueryQuery, ContactsQueryQueryVariables>;
|
||||||
|
export const SiteSettingsQueryDocument = new TypedDocumentString(`
|
||||||
|
query SiteSettingsQuery {
|
||||||
|
global {
|
||||||
|
ym_counter
|
||||||
|
recent_articles_limit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`) as unknown as TypedDocumentString<SiteSettingsQueryQuery, SiteSettingsQueryQueryVariables>;
|
||||||
export const Project_TranslationsDocument = new TypedDocumentString(`
|
export const Project_TranslationsDocument = new TypedDocumentString(`
|
||||||
query Project_translations($pageLang: String!) {
|
query Project_translations($pageLang: String!) {
|
||||||
project_translations(
|
project_translations(
|
||||||
|
|||||||
@ -16,3 +16,34 @@ export async function getAboutMe(pageLang: string) {
|
|||||||
|
|
||||||
return result.data.global_translations[0];
|
return result.data.global_translations[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getContacts() {
|
||||||
|
const ContactsQuery = graphql(`
|
||||||
|
query ContactsQuery {
|
||||||
|
global {
|
||||||
|
email
|
||||||
|
github
|
||||||
|
telegram
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
|
||||||
|
const result = await execute(ContactsQuery);
|
||||||
|
|
||||||
|
return result.data?.global;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getSiteSettings() {
|
||||||
|
const SiteSettingsQuery = graphql(`
|
||||||
|
query SiteSettingsQuery {
|
||||||
|
global {
|
||||||
|
ym_counter
|
||||||
|
recent_articles_limit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`);
|
||||||
|
|
||||||
|
const result = await execute(SiteSettingsQuery);
|
||||||
|
|
||||||
|
return result.data?.global;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user