diff --git a/src/components/SocialLinks.astro b/src/components/SocialLinks.astro new file mode 100644 index 0000000..80e1f44 --- /dev/null +++ b/src/components/SocialLinks.astro @@ -0,0 +1,23 @@ +--- +import { SOCIAL } from '../consts'; +--- +
+ + + Telegram + + + + ВКонтакте + + +
diff --git a/src/consts.ts b/src/consts.ts index 45b9219..3fad124 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -1,3 +1,18 @@ +export const SOCIAL = { + telegram: { url: 'https://t.me/anotherreflections', label: 'Telegram' }, + vk: { url: 'https://vk.com/anotherreflections', label: 'ВКонтакте' }, +}; + +/** Русская плюрализация: [1, 2-4, 5+]. Пример: plural(8, ['мир', 'мира', 'миров']) → 'миров' */ +export function plural(n: number, forms: [string, string, string]): string { + const a = Math.abs(n) % 100; + const b = a % 10; + if (a > 10 && a < 20) return forms[2]; + if (b > 1 && b < 5) return forms[1]; + if (b === 1) return forms[0]; + return forms[2]; +} + export const SITE_TITLE = 'Иные Отражения'; export const SITE_DESCRIPTION = 'Ролевой проект по современной фантастике. Дозоры С. Лукьяненко, Амбер Р. Желязны, А. Пехов.'; export const SITE_URL = 'https://anotherreflections.ru'; @@ -69,7 +84,7 @@ export const WORLDS: World[] = [ { name: 'Ренессанс', tag: 'Историческая фантастика', - desc: 'Эпоха возрождения с фантастическими допущениями.', + desc: 'Эпоха Возрождения с фантастическими допущениями мира Сумрака.', url: 'https://renessans.anotherreflections.ru/', color: 'var(--c-roleplay)', }, diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index a99c2cd..41cfcc3 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -2,6 +2,7 @@ import '../styles/global.css'; import { SITE_TITLE, SITE_DESCRIPTION, SITE_URL, SITE_LANG, MAIN_NAV } from '../consts'; import BrandMark from '../components/BrandMark.astro'; +import SocialLinks from '../components/SocialLinks.astro'; interface Props { title?: string; @@ -60,6 +61,7 @@ const year = new Date().getFullYear();
+