Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DISCOVERY-293: Add local nav pointers #310

Conversation

azinit
Copy link
Member

@azinit azinit commented Oct 23, 2021

DISCLAIMER

Смело дели пополам дифф, т.к. это удвоение диффа из-за двух локалей

image

CHANGELOG

  • feat: Добавил навигационные карты для каждой секции
    • (GetStarted, Guides, Concepts, Reference, About)
    • Поправил пагинацию и порядок, чтобы nav-item рутовый был на самом верху
    • С отображением бейджа-цели, описания и основных статей в каждой такой странице
    • Для каждой такой статьи подобрал актуальную иконку для более очевидного UX и мб ассоциативности
  • feat: Добавил "index"-овые урлы для этих navpointers, и актуализировал редиректы
  • feat: Для всего этого реализовал доп. компонент Row

💻- Light, EN

fs.navpointers.light.en.mp4

💻 - Dark, RU

fs.navpointers.dark.ru.mp4

📱 - Light, RU
image

📱 - Dark, RU
image

Чеклист

  • Если при работе с документацией потребовалось использовать github-дискуссии, то стоит их прикрепить как see-also источники
  • Если PR связан с задачей, то необходимо проверить, что все требования по задаче выполнены
  • Перед тем, как отправлять изменения на ревью, нужно ознакомиться с CONTIBUTING-гайдлайнами
  • Перед тем, как отправлять изменения на ревью, нужно провести self-review своих изменений
  • Перед тем, как отправлять изменения на ревью, нужно дождаться CI-проверок
  • Перед тем, как отправлять изменения на ревью, нужно дать краткое описание изменений

@azinit azinit changed the base branch from master to feature/FEEDBACK-276-add-feedback-widget October 23, 2021 16:40
@azinit azinit linked an issue Oct 23, 2021 that may be closed by this pull request
5 tasks
@azinit azinit self-assigned this Oct 23, 2021
Copy link
Member Author

@azinit azinit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self-reviewed

Фух... Вродь постарался много подсказок оставить для облегчения ревью)

Comment on lines +11 to +31
// FIXME: Привести в порядок формат урлов
const SECTIONS = {
INTRO: {
shortPath: "/docs",
fullPath: "/docs/intro",
},
GET_STARTED: {
shortPath: "/docs/get-started",
fullPath: "/docs/get-started/overview",
fullPath: "/docs/get-started",
},
CONCEPTS: {
shortPath: "/docs/concepts",
fullPath: "/docs/concepts/architecture",
fullPath: "/docs/concepts",
},
GUIDES: {
shortPath: "/docs/guides",
fullPath: "/docs/guides/migration-from-v1",
fullPath: "/docs/guides",
},
REFERENCE: {
shortPath: "/docs/reference",
fullPath: "/docs/reference/glossary",
fullPath: "/docs/reference",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Позже выпилить бы совсем, но out-of-scope пока

Comment on lines +1 to +27
---
sidebar_position: 0
sidebar_class_name: sidebar-item--root
hide_table_of_contents: true
slug: /about
pagination_prev: reference/knowledge-types
---

# 🍰 About

<span class="badge badge--violet margin-bottom--md">COMMUNITY-ORIENTED</span>

<p class="summary">
General information about methodology, team, community and development history
</p>

## Main

import Row from "@site/src/shared/ui/row/tmpl.mdx"
import { StarOutlined } from "@ant-design/icons";

<Row
title="Mission"
description="Goals and limitations of the methodology"
to="/docs/about/mission"
Icon={StarOutlined}
/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь опишу на примере одной index-овой статьи, дальше можно ревьювить по аналогии

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sidebar_position: 0

Отображается выше всех

sidebar_class_name: sidebar-item--root

Для доп стилей поинтера в сайдбаре (чтобы отличался от других визуально)

hide_table_of_contents: true

Иначе выглядит странно, т.к. TOC состоит из одного пункта ## Main

Да и визуально от обычных статей отличается - тоже хорошо

slug: /about

Было два пути:

  • либо так, с индексовым файлом внутри,
  • либо выносить в файл /about.mdx с кучей проблем

Выбрал меньшее зло, и кмк - вполне неплохой компромисс по итогу вышел

pagination_prev: reference/knowledge-types

Каждая такая индексовая страница линкуется с концом предыдущего раздела

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# 🍰 About

Сделал вместе с эмодзи для визуального отличия в пагинации и сайдбаре

image

image

<span class="badge badge--violet margin-bottom--md">COMMUNITY-ORIENTED</span>

Попробовал ради интереса отобразить семантичные теги согласно diataxis - вышло неплохо кмк 🤔

image

image

image

image

image

image

<p class="summary">

Взял как у аналогов

image

## Main

Тож как у аналогов - отображаю ключевые статьи из раздела, чтобы не распылялось внимание читателя

title="Mission" 
description="Goals and limitations of the methodology"
to="/docs/about/mission"
Icon={StarOutlined}

С тайтлом карточки, саммари для понимания о чем статья и семантичной иконкой

image

@@ -1,6 +1,5 @@
---
sidebar_position: 1
pagination_prev: reference/knowledge-types
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну а здесь и далее убрал старую индексацию основных страниц категорий, т.к. теперь ими стали наши навпоинтеры

pagination_prev: reference/knowledge-types
---

# 🍰 О методологии
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А теперь все тож самое но на русском 🤯🤯🤯

@@ -1,6 +1,6 @@
---
sidebar_position: 10
pagination_next: about/mission
pagination_next: about/index
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Последняя дока из диффа фух!

Comment on lines +159 to +175
.sidebar-item--root {
margin-bottom: 6px;
font-weight: bold;
text-transform: uppercase;
}

.summary {
padding-bottom: 2rem;
font-size: 1.25rem;
color: var(--ifm-color-gray-600);
border-bottom: 1px solid var(--ifm-color-gray-400);
}

.badge--violet {
--ifm-badge-background-color: #5c21dd;
--ifm-badge-border-color: var(--ifm-badge-background-color);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Стили для navpointers)

}

html[data-theme=dark] .badge--warning {
--ifm-badge-background-color: var(--ifm-color-warning-dark);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну а тут хак, т.к. в светлой теме желтый бейдж слишком ярко выглядит

* Row card for linking
* @see https://docusaurus.io/docs/next/markdown-features/react#importing-markdown
*/
export const Row = ({ title, description, to, Icon }) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Собсна, карточка статьи для отображения в навпоинтере

@@ -0,0 +1,3 @@
import Row from "./index.jsx";

<Row {...props} />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это особенный костыль вид синтаксиса для переиспользования в mdx

@@ -0,0 +1,41 @@
.root {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Полтоно стилей - если видите как упростить - welcome)

@azinit azinit merged commit df35628 into feature/FEEDBACK-276-add-feedback-widget Oct 24, 2021
@azinit azinit deleted the feature/DISCOVERY-293-nav-pointers-locally branch October 24, 2021 10:41
@azinit azinit restored the feature/DISCOVERY-293-nav-pointers-locally branch October 24, 2021 10:42
@azinit azinit deleted the feature/DISCOVERY-293-nav-pointers-locally branch October 24, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DISCOVERY: Add nav-pointers (locally)
3 participants