-
Notifications
You must be signed in to change notification settings - Fork 162
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
DISCOVERY-293: Add local nav pointers #310
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self-reviewed
Фух... Вродь постарался много подсказок оставить для облегчения ревью)
// 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Позже выпилить бы совсем, но out-of-scope пока
--- | ||
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} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь опишу на примере одной index-овой статьи, дальше можно ревьювить по аналогии
There was a problem hiding this comment.
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
Каждая такая индексовая страница линкуется с концом предыдущего раздела
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 🍰 About
Сделал вместе с эмодзи для визуального отличия в пагинации и сайдбаре
<span class="badge badge--violet margin-bottom--md">COMMUNITY-ORIENTED</span>
Попробовал ради интереса отобразить семантичные теги согласно diataxis - вышло неплохо кмк 🤔
<p class="summary">
Взял как у аналогов
## Main
Тож как у аналогов - отображаю ключевые статьи из раздела, чтобы не распылялось внимание читателя
title="Mission" description="Goals and limitations of the methodology" to="/docs/about/mission" Icon={StarOutlined}
С тайтлом карточки, саммари для понимания о чем статья и семантичной иконкой
@@ -1,6 +1,5 @@ | |||
--- | |||
sidebar_position: 1 | |||
pagination_prev: reference/knowledge-types |
There was a problem hiding this comment.
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 | ||
--- | ||
|
||
# 🍰 О методологии |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Последняя дока из диффа фух!
.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); | ||
} |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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 }) => { |
There was a problem hiding this comment.
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} /> |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Полтоно стилей - если видите как упростить - welcome)
DISCLAIMER
Смело дели пополам дифф, т.к. это удвоение диффа из-за двух локалей
CHANGELOG
feat:
Добавил навигационные карты для каждой секцииfeat:
Добавил "index"-овые урлы для этих navpointers, и актуализировал редиректыfeat:
Для всего этого реализовал доп. компонент Row💻- Light, EN
fs.navpointers.light.en.mp4
💻 - Dark, RU
fs.navpointers.dark.ru.mp4
📱 - Light, RU
📱 - Dark, RU
Чеклист