From bc3245cd34a98c37f6cc713d93432ba005ccc8d3 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Thu, 29 Oct 2026 01:11:01 +0100 Subject: [PATCH] Cleanup project --- crowdin.yml | 3 +-- docusaurus.config.ts | 15 ++++----------- scripts/postbuild.mjs | 6 +++--- sidebars.ts | 24 ------------------------ src/remark/figure.ts | 2 +- src/theme/Footer/Copyright/index.tsx | 4 ++-- 6 files changed, 11 insertions(+), 43 deletions(-) diff --git a/crowdin.yml b/crowdin.yml index fd85ab8..c877303 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -10,8 +10,7 @@ files: # Documentation pages - source: /docs/**/* translation: /i18n/%two_letters_code%/docusaurus-plugin-content-docs/current/**/%original_file_name% - # Translate whole paragraphs instead of single sentences: the sentence splitting breaks on abbreviations - # like "т.к." or "см." and loses the context + # Translate whole paragraphs instead of single sentences content_segmentation: false # Crowdin language => Docusaurus locale (i18n directory name). Must match the localeConfigs # in docusaurus.config.ts and LOCALES_MAPPING in scripts/crowdin-locales.mjs diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 6eaee20..69768c2 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,10 +1,8 @@ -import {themes as prismThemes} from 'prism-react-renderer'; -import type {Config, I18nLocaleConfig} from '@docusaurus/types'; +import { themes as prismThemes } from 'prism-react-renderer'; +import type { Config, I18nLocaleConfig } from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; import remarkFigure from './src/remark/figure'; -// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) - // All locales the documentation can be built for. Translations are downloaded from Crowdin during the CI build const localeConfigs: Record> = { ru: { @@ -130,10 +128,6 @@ const config: Config = { { title: 'Сообщество', items: [ - { - label: 'X (Twitter)', - href: 'https://x.com/erickskrauch', - }, { label: 'YouTube', href: 'https://www.youtube.com/c/ElyByOfficial', @@ -149,9 +143,8 @@ const config: Config = { ], }, ], - // {year} is replaced with the build year by the swizzled Footer/Copyright component, so the translatable - // string doesn't change every year - copyright: 'Copyright © {year} Ely.by. Built with Docusaurus.', + // {year} is replaced with the build year by the swizzled Footer/Copyright component + copyright: 'Ely.by © {year}. Создано с использованием Docusaurus.', }, prism: { theme: prismThemes.github, diff --git a/scripts/postbuild.mjs b/scripts/postbuild.mjs index 6fefb38..c9c3271 100644 --- a/scripts/postbuild.mjs +++ b/scripts/postbuild.mjs @@ -1,9 +1,9 @@ // Assembles the site root after "docusaurus build". // Every locale is built into its own build// directory (see i18n.localeConfigs in // docusaurus.config.ts), so files that must live in the site root are placed here. -import {cpSync, copyFileSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync} from 'node:fs'; -import {dirname, join} from 'node:path'; -import {fileURLToPath} from 'node:url'; +import { cpSync, copyFileSync, existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; const SITE_URL = 'https://docs.ely.by'; const DEFAULT_PREFIX = 'ru'; diff --git a/sidebars.ts b/sidebars.ts index dbe9fb5..bd08ea5 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -2,32 +2,8 @@ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) -/** - * Creating a sidebar enables you to: -- create an ordered group of docs -- render a sidebar for each doc of that group -- provide next/previous navigation - -The sidebars can be generated from the filesystem, or explicitly defined here. - -Create as many sidebars as you want. - */ const sidebars: SidebarsConfig = { - // By default, Docusaurus generates a sidebar from the docs folder structure tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], - - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', - { - type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], - }, - ], - */ }; export default sidebars; diff --git a/src/remark/figure.ts b/src/remark/figure.ts index 5e4c8e1..4b9146b 100644 --- a/src/remark/figure.ts +++ b/src/remark/figure.ts @@ -1,4 +1,4 @@ -import type {Image, Paragraph, Parent, Root} from 'mdast'; +import type { Image, Paragraph, Parent, Root } from 'mdast'; // Turns a paragraph that contains only an image with a title into a figure with a caption: // diff --git a/src/theme/Footer/Copyright/index.tsx b/src/theme/Footer/Copyright/index.tsx index d0329b3..abc3d1a 100644 --- a/src/theme/Footer/Copyright/index.tsx +++ b/src/theme/Footer/Copyright/index.tsx @@ -1,6 +1,6 @@ -import React, {type ReactNode} from 'react'; +import React, { type ReactNode } from 'react'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import type {Props} from '@theme/Footer/Copyright'; +import type { Props } from '@theme/Footer/Copyright'; // Replaces the {year} placeholder in the copyright with the year of the build. // The year is taken from the build time (not the client's clock) to avoid hydration mismatches