diff --git a/astro.config.mjs b/astro.config.mjs index 53f0965..646a820 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -21,7 +21,7 @@ import { h } from "hastscript"; import { toString } from "hast-util-to-string"; import { escape } from "html-escaper"; import languages from "./src/i18n/languages"; -import { DEFAULT_LANGUAGE, SUPPORTED_LANGUAGES, SITE_METADATA } from "./src/constants"; +import { DEFAULT_LANGUAGE, SUPPORTED_LANGUAGES } from "./src/constants"; const createAnchorLabel = (heading) => { const node = h("span.anchor-label", escape(heading)); @@ -339,6 +339,32 @@ export default defineConfig({ }, ], }, + { + label: "Контакты", + name: "contacts", + widget: "object", + required: false, + fields: [ + { + label: "Telegram", + name: "telegram", + widget: "string", + required: false, + }, + { + label: "Почта", + name: "email", + widget: "string", + required: false, + }, + { + label: "Github", + name: "github", + widget: "string", + required: false, + }, + ], + }, ], }, ], diff --git a/siteconfig.json b/siteconfig.json index a46f94a..163350d 100644 --- a/siteconfig.json +++ b/siteconfig.json @@ -3,5 +3,10 @@ "articles": { "recentLimit": 5 }, - "isSiteUnderConstruction": false + "isSiteUnderConstruction": false, + "contacts": { + "email": "serzh.yarkov@gmail.com", + "telegram": "https://t.me/sergeyyarkov", + "github": "https://github.com/sergeyyarkov" + } } \ No newline at end of file diff --git a/src/components/Header/Header.astro b/src/components/Header/Header.astro index 11aea74..47cd8fd 100644 --- a/src/components/Header/Header.astro +++ b/src/components/Header/Header.astro @@ -1,10 +1,10 @@ --- import { Icon } from "astro-icon"; import { IS_SITE_UNDER_CONSTRUCTION, SITE_METADATA } from "@root/constants"; -import HeaderLink from "./HeaderLink.astro"; import ThemeSwitcher from "@components/ThemeSwticher"; import LanguageSelect from "@components/LanguageSelect.astro"; import NavToggle from "@components/NavToggle"; +import HeaderLink from "./HeaderLink.astro"; ---
@@ -39,20 +39,20 @@ import NavToggle from "@components/NavToggle"; ) } -
- + {SITE_METADATA.contacts && +
}
diff --git a/src/components/NavToggle/NavToggle.tsx b/src/components/NavToggle/NavToggle.tsx index 712149c..3856900 100644 --- a/src/components/NavToggle/NavToggle.tsx +++ b/src/components/NavToggle/NavToggle.tsx @@ -1,16 +1,27 @@ import type { Component } from "solid-js"; - import { createSignal, createEffect } from "solid-js"; import "./NavToggle.scss"; const MenuIcon: Component = () => ( - + ); const CloseIcon: Component = () => ( - + ); @@ -32,7 +43,13 @@ const NavToggle: Component = () => { }); return ( -