refactor docs

This commit is contained in:
2025-03-19 14:38:58 +03:00
parent a7548d5e3b
commit 1086a3c681
9 changed files with 1643 additions and 26 deletions

View File

@@ -6,19 +6,19 @@ import type * as Preset from '@docusaurus/preset-classic';
const config: Config = { const config: Config = {
title: 'Frontend Docs', title: 'Frontend Docs',
tagline: 'Dinosaurs are cool', tagline: 'Made with Dinosaurs',
favicon: 'img/favicon.ico', favicon: 'img/favicon.png',
// Set the production url of your site here // Set the production url of your site here
url: 'https://your-docusaurus-site.example.com', url: 'https://frontend-docs-azure.vercel.app/',
// Set the /<baseUrl>/ pathname under which your site is served // Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/' // For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/', baseUrl: '/',
// GitHub pages deployment config. // GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these. // If you aren't using GitHub pages, you don't need these.
organizationName: 'facebook', // Usually your GitHub org/user name. organizationName: 'Redrock corp.', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name. projectName: 'fe-docs', // Usually your repo name.
onBrokenLinks: 'throw', onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn', onBrokenMarkdownLinks: 'warn',
@@ -66,19 +66,19 @@ const config: Config = {
themeConfig: { themeConfig: {
// Replace with your project's social card // Replace with your project's social card
image: 'img/docusaurus-social-card.jpg', image: 'svg/developer-logo.svg',
navbar: { navbar: {
title: 'Frontend Docs', title: 'Frontend Docs',
logo: { logo: {
alt: 'Frontend Docs', alt: 'Frontend Docs',
src: 'img/logo.svg', src: 'svg/developer-logo.svg',
}, },
items: [ items: [
{ {
type: 'docSidebar', type: 'docSidebar',
sidebarId: 'tutorialSidebar', sidebarId: 'tutorialSidebar',
position: 'left', position: 'left',
label: 'Questions', label: 'Документация',
}, },
// {to: '/blog', label: 'Blog', position: 'left'}, // {to: '/blog', label: 'Blog', position: 'left'},
{ {
@@ -92,14 +92,40 @@ const config: Config = {
style: 'dark', style: 'dark',
links: [ links: [
{ {
title: 'Docs', title: 'Frontend Docs',
items: [ items: [
{ {
label: 'Questions', label: 'Документация',
to: '/docs/category/browser', to: '/docs/category/browser',
} }
], ],
}, },
{
title: 'Ссылки',
items: [
{
label: 'Learn.javascript.ru',
to: 'https://learn.javascript.ru/',
},
{
label: 'Typescript Lang',
to: 'https://www.typescriptlang.org/',
},
{
label: 'React Dev',
to: 'https://ru.react.dev/learn',
},
],
},
{
title: 'Справочники',
items: [
{
label: 'Дока',
to: 'https://doka.guide/'
}
]
}
], ],
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`, copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
}, },

View File

@@ -5,51 +5,58 @@ import styles from './styles.module.css';
type FeatureItem = { type FeatureItem = {
title: string; title: string;
link: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>; Svg: React.ComponentType<React.ComponentProps<'svg'>>;
description: ReactNode; description: ReactNode;
}; };
const FeatureList: FeatureItem[] = [ const FeatureList: FeatureItem[] = [
{ {
title: 'Easy to Use', title: 'JavaScript',
Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, link: 'https://learn.javascript.ru/',
Svg: require('@site/static/svg/js-logo.svg').default,
description: ( description: (
<> <>
Docusaurus was designed from the ground up to be easily installed and Современный учебник JavaScript <br/>
used to get your website up and running quickly. Перед вами учебник по JavaScript, начиная с основ, включающий в себя много тонкостей и фишек JavaScript/DOM.
</> </>
), ),
}, },
{ {
title: 'Focus on What Matters', title: 'Typescript handbook',
Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, link: 'https://typescript-handbook.ru/',
Svg: require('@site/static/svg/ts-logo.svg').default,
description: ( description: (
<> <>
Docusaurus lets you focus on your docs, and we&apos;ll do the chores. Go Руководство, шпаргалки, вопросы и другие материалы по TypeScript
ahead and move your docs into the <code>docs</code> directory.
</> </>
), ),
}, },
{ {
title: 'Powered by React', title: 'React.dev',
Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, link: 'https://ru.react.dev/learn',
Svg: require('@site/static/svg/react-logo.svg').default,
description: ( description: (
<> <>
Extend or customize your website layout by reusing React. Docusaurus can Добро пожаловать в документацию React! <br/>
be extended while reusing the same header and footer. Эта страница познакомит вас с большинством концепций React, которыми вы будете пользоваться каждый день.
</> </>
), ),
}, },
]; ];
function Feature({title, Svg, description}: FeatureItem) { function Feature({title, link, Svg, description}: FeatureItem) {
return ( return (
<div className={clsx('col col--4')}> <div className={clsx('col col--4')}>
<div className="text--center"> <div className="text--center">
<a href={link} target="_blank" rel="noreferrer">
<Svg className={styles.featureSvg} role="img" /> <Svg className={styles.featureSvg} role="img" />
</a>
</div> </div>
<div className="text--center padding-horiz--md"> <div className="text--center padding-horiz--md">
<Heading as="h3">{title}</Heading> <Heading as="h3">
<a href={link} target="_blank" rel="noreferrer">{title}</a>
</Heading>
<p>{description}</p> <p>{description}</p>
</div> </div>
</div> </div>

View File

@@ -32,7 +32,7 @@ export default function Home(): ReactNode {
const {siteConfig} = useDocusaurusContext(); const {siteConfig} = useDocusaurusContext();
return ( return (
<Layout <Layout
title={`Hello from ${siteConfig.title}`} title={`${siteConfig.title}`}
description="Description will go into a meta tag in <head />"> description="Description will go into a meta tag in <head />">
<HomepageHeader /> <HomepageHeader />
<main> <main>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/img/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 121 KiB

4
static/svg/js-logo.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 630">
<rect width="630" height="630" fill="#f7df1e"/>
<path d="m423.2 492.19c12.69 20.72 29.2 35.95 58.4 35.95 24.53 0 40.2-12.26 40.2-29.2 0-20.3-16.1-27.49-43.1-39.3l-14.8-6.35c-42.72-18.2-71.1-41-71.1-89.2 0-44.4 33.83-78.2 86.7-78.2 37.64 0 64.7 13.1 84.2 47.4l-46.1 29.6c-10.15-18.2-21.1-25.37-38.1-25.37-17.34 0-28.33 11-28.33 25.37 0 17.76 11 24.95 36.4 35.95l14.8 6.34c50.3 21.57 78.7 43.56 78.7 93 0 53.3-41.87 82.5-98.1 82.5-54.98 0-90.5-26.2-107.88-60.54zm-209.13 5.13c9.3 16.5 17.76 30.45 38.1 30.45 19.45 0 31.72-7.61 31.72-37.2v-201.3h59.2v202.1c0 61.3-35.94 89.2-88.4 89.2-47.4 0-74.85-24.53-88.81-54.075z"/>
</svg>

After

Width:  |  Height:  |  Size: 687 B

View File

@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-11.5 -10.23174 23 20.46348">
<title>React Logo</title>
<circle cx="0" cy="0" r="2.05" fill="#61dafb"/>
<g stroke="#61dafb" stroke-width="1" fill="none">
<ellipse rx="11" ry="4.2"/>
<ellipse rx="11" ry="4.2" transform="rotate(60)"/>
<ellipse rx="11" ry="4.2" transform="rotate(120)"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 366 B

1
static/svg/ts-logo.svg Normal file
View File

@@ -0,0 +1 @@
<svg fill="none" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><rect fill="#3178c6" height="512" rx="50" width="512"/><rect fill="#3178c6" height="512" rx="50" width="512"/><path clip-rule="evenodd" d="m316.939 407.424v50.061c8.138 4.172 17.763 7.3 28.875 9.386s22.823 3.129 35.135 3.129c11.999 0 23.397-1.147 34.196-3.442 10.799-2.294 20.268-6.075 28.406-11.342 8.138-5.266 14.581-12.15 19.328-20.65s7.121-19.007 7.121-31.522c0-9.074-1.356-17.026-4.069-23.857s-6.625-12.906-11.738-18.225c-5.112-5.319-11.242-10.091-18.389-14.315s-15.207-8.213-24.18-11.967c-6.573-2.712-12.468-5.345-17.685-7.9-5.217-2.556-9.651-5.163-13.303-7.822-3.652-2.66-6.469-5.476-8.451-8.448-1.982-2.973-2.974-6.336-2.974-10.091 0-3.441.887-6.544 2.661-9.308s4.278-5.136 7.512-7.118c3.235-1.981 7.199-3.52 11.894-4.615 4.696-1.095 9.912-1.642 15.651-1.642 4.173 0 8.581.313 13.224.938 4.643.626 9.312 1.591 14.008 2.894 4.695 1.304 9.259 2.947 13.694 4.928 4.434 1.982 8.529 4.276 12.285 6.884v-46.776c-7.616-2.92-15.937-5.084-24.962-6.492s-19.381-2.112-31.066-2.112c-11.895 0-23.163 1.278-33.805 3.833s-20.006 6.544-28.093 11.967c-8.086 5.424-14.476 12.333-19.171 20.729-4.695 8.395-7.043 18.433-7.043 30.114 0 14.914 4.304 27.638 12.912 38.172 8.607 10.533 21.675 19.45 39.204 26.751 6.886 2.816 13.303 5.579 19.25 8.291s11.086 5.528 15.415 8.448c4.33 2.92 7.747 6.101 10.252 9.543 2.504 3.441 3.756 7.352 3.756 11.733 0 3.233-.783 6.231-2.348 8.995s-3.939 5.162-7.121 7.196-7.147 3.624-11.894 4.771c-4.748 1.148-10.303 1.721-16.668 1.721-10.851 0-21.597-1.903-32.24-5.71-10.642-3.806-20.502-9.516-29.579-17.13zm-84.159-123.342h64.22v-41.082h-179v41.082h63.906v182.918h50.874z" fill="#fff" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB