Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,30 @@ All notable changes to Docara are recorded here. The format follows

## [Unreleased]

### Added

- Hero `effect_narrow` (`hide` by default, or `show`): below 704 px (the
Framework's md), where the hero is one column and its text spans the block,
a background effect is no longer drawn under the heading, the text and the
buttons. The hero keeps the surface it has before an effect runs, the pause
button is not shown and the effect is paused; from md it runs again.
`effect_narrow=show` keeps the effect at every width.

### Fixed

- Full-width landing blocks (the home hero) no longer sit half a scrollbar to
the left with a classic vertical scrollbar: 100vw counts the scrollbar, so
the shell measures it into `--docara-scrollbar-inline-size` and the block
leaves it out. The hero heading now starts at the page gutter (12 px at
390 px, 48 px at 1440 px; it was 5 and 41).
- With SIMAI Framework `sf-header-site` 1.11, a collapsed header kept only the
menu button and the logo on a page with a language picker (the home page):
the bar moves the slotted tools element that holds the language picker into
its panel, and the search and reader settings were in that same element.
The language picker is now a tools element of its own, so search and
reader settings stay in the narrow header as on documentation pages, and
only the language moves to the panel.

- Link previews: pages state the share image's type, width, height and alt
text (`og:image:type`, `og:image:width`, `og:image:height`,
`og:image:alt`), so messengers and social networks draw the card at once.
Expand Down
22 changes: 20 additions & 2 deletions docs/site/content/en/components/effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ or `media=background`.
| `effect` | An effect identifier from the catalogue, 2 to 41 characters, or the `https` address of its `effect.json` file inside the catalogue. |
| `effect_theme` | The light or dark version of the effect: `auto` follows the page (the default), `dark` or `light`. |
| `effect_settings` | The effect settings — a JSON object in single quotes, for example `'{"speed": 80}'`. effects.simai.io shows which settings an effect has. |
| `effect_narrow` | The effect on a narrow screen, below 704 px: `hide` does not show it (the default), `show` shows it. |

```markdown
:::hero {layout=centered effect=aurora-curtain effect_theme=dark effect_settings='{"speed": 80}'}
Expand Down Expand Up @@ -136,6 +137,23 @@ Elevation lines, as on a topographic map.
All the catalogue's effects and their settings are shown on
[effects.simai.io](https://effects.simai.io/).

## Narrow screens

Below 704 px the Hero is one column, and its text spans the whole width. The
effect would be drawn under the heading, the text and the buttons, so by
default it is not shown there: the Hero keeps the background it has before
the effect starts, the pause button does not appear, and the effect itself
is paused. From 704 px the effect is visible again.

To show the effect at every width, for example a calm background under a
short heading, set `effect_narrow=show`:

```markdown
:::hero {layout=centered effect=aurora-curtain effect_narrow=show}
# Documentation that is easy to read
:::
```

## Pause and reduced motion

While the effect moves, the bottom right corner of the Hero (the left one in
Expand Down Expand Up @@ -199,10 +217,10 @@ each error are in the reference:
| Code | When it occurs |
| --- | --- |
| `MARKDOWN_HERO_EFFECT_INVALID` | `effect` is neither an effect identifier nor an `effect.json` address. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme` or `effect_settings` are set without `effect`. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme`, `effect_settings` or `effect_narrow` are set without `effect`. |
| `MARKDOWN_HERO_EFFECT_SETTINGS_INVALID` | `effect_settings` is not a JSON object. |
| `MARKDOWN_HERO_EFFECT_MEDIA_CONFLICT` | One Hero has both an effect and a background image. |
| `MARKDOWN_COMPONENT_ATTRIBUTE_VALUE_INVALID` | `effect_theme` has a value other than `auto`, `dark` or `light`. |
| `MARKDOWN_COMPONENT_ATTRIBUTE_VALUE_INVALID` | `effect_theme` has a value other than `auto`, `dark` or `light`, or `effect_narrow` other than `hide` or `show`. |
| `EFFECTS_CATALOGUE_REQUIRED` | A page uses an effect, but `docara.json` has no `effects.catalogue`. |
| `EFFECTS_OUTSIDE_CATALOGUE` | The effect is given by an address outside the connected catalogue. Docara builds only the catalogue's effects. |
| `EFFECTS_CATALOGUE_INVALID` | The catalogue address is not `https://`, does not end with `/` or contains invalid characters. |
Expand Down
1 change: 1 addition & 0 deletions docs/site/content/en/components/hero.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ motion is turned on in the system, the effect shows a still frame.
| `effect` | string | — | The name of a SIMAI Framework background effect. |
| `effect_theme` | `auto`, `dark`, `light` | `auto` | The effect theme: follows the page theme, always dark or always light. |
| `effect_settings` | string | — | The effect settings as JSON. |
| `effect_narrow` | `hide`, `show` | `hide` | The effect below 704 px: hidden, since the text spans the Hero there, or shown. |

<!-- docara:component-parameters:end -->

Expand Down
2 changes: 1 addition & 1 deletion docs/site/content/en/reference/errors/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Markdown blocks start with a `:::name` line and end with a `:::` line.
| `MARKDOWN_HERO_SIDE_IMAGE_CASE_MISMATCH`, `MARKDOWN_HERO_BACKGROUND_CASE_MISMATCH` | The letter case in the path does not match the file name. **What to do:** Fix the path. |
| `MARKDOWN_HERO_SIDE_IMAGE_CONTEXT_INVALID`, `MARKDOWN_HERO_BACKGROUND_CONTEXT_INVALID` | An image from `/assets/` is used by a file outside `content/<language>/`. **What to do:** Use the hero on pages in a language folder. |
| `MARKDOWN_HERO_EFFECT_INVALID` | `effect` is neither an effect name from the catalogue nor an `https://.../effect.json` address. **What to do:** Give an effect name, for example `aurora-curtain`. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme` or `effect_settings` is given without `effect`. **What to do:** Add `effect` or remove these attributes. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme`, `effect_settings` or `effect_narrow` is given without `effect`. **What to do:** Add `effect` or remove these attributes. |
| `MARKDOWN_HERO_EFFECT_SETTINGS_INVALID` | `effect_settings` is not a JSON object. **What to do:** Write the settings as `{"speed": 0.5}`. |
| `MARKDOWN_HERO_EFFECT_MEDIA_CONFLICT` | A background effect and a background image at once. **What to do:** Keep one of them. |

Expand Down
22 changes: 20 additions & 2 deletions docs/site/content/ru/components/effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Hero, но не с фоновой картинкой: укажите либо `e
| `effect` | Идентификатор эффекта из каталога, от 2 до 41 символа, или `https`-адрес его файла `effect.json` внутри каталога. |
| `effect_theme` | Светлая или тёмная версия эффекта: `auto` — как у страницы (по умолчанию), `dark` или `light`. |
| `effect_settings` | Настройки эффекта — объект JSON в одинарных кавычках, например `'{"speed": 80}'`. Какие настройки есть у эффекта, показано на effects.simai.io. |
| `effect_narrow` | Эффект на узком экране, уже 704 px: `hide` — не показывать (по умолчанию), `show` — показывать. |

```markdown
:::hero {layout=centered effect=aurora-curtain effect_theme=dark effect_settings='{"speed": 80}'}
Expand Down Expand Up @@ -134,6 +135,23 @@ Hero, но не с фоновой картинкой: укажите либо `e
Все эффекты каталога и их настройки показаны на
[effects.simai.io](https://effects.simai.io/).

## Узкий экран

На экране уже 704 px Hero занимает одну колонку, и текст идёт во всю его
ширину. Эффект оказался бы под заголовком, текстом и кнопками, поэтому там он
по умолчанию не показывается: Hero остаётся с фоном, который у него до запуска
эффекта, кнопки паузы нет, а сам эффект стоит на паузе. Шире 704 px эффект
снова виден.

Чтобы эффект был виден на любой ширине, например спокойный фон под коротким
заголовком, задайте `effect_narrow=show`:

```markdown
:::hero {layout=centered effect=aurora-curtain effect_narrow=show}
# Документация, которую легко читать
:::
```

## Пауза и уменьшение движения

Пока эффект движется, в правом нижнем углу Hero (на языках с письмом справа
Expand Down Expand Up @@ -192,10 +210,10 @@ Docara не задаёт заголовок Content-Security-Policy. Если в
| Код | Когда возникает |
| --- | --- |
| `MARKDOWN_HERO_EFFECT_INVALID` | `effect` — не идентификатор эффекта и не адрес `effect.json`. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme` или `effect_settings` указаны без `effect`. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme`, `effect_settings` или `effect_narrow` указаны без `effect`. |
| `MARKDOWN_HERO_EFFECT_SETTINGS_INVALID` | `effect_settings` — не объект JSON. |
| `MARKDOWN_HERO_EFFECT_MEDIA_CONFLICT` | В одном Hero и эффект, и фоновая картинка. |
| `MARKDOWN_COMPONENT_ATTRIBUTE_VALUE_INVALID` | У `effect_theme` значение не `auto`, `dark` или `light`. |
| `MARKDOWN_COMPONENT_ATTRIBUTE_VALUE_INVALID` | У `effect_theme` значение не `auto`, `dark` или `light`, или у `effect_narrow` — не `hide` или `show`. |
| `EFFECTS_CATALOGUE_REQUIRED` | Страница использует эффект, а в `docara.json` нет `effects.catalogue`. |
| `EFFECTS_OUTSIDE_CATALOGUE` | Эффект указан адресом вне подключённого каталога. Docara собирает только эффекты каталога. |
| `EFFECTS_CATALOGUE_INVALID` | Адрес каталога не `https://`, не заканчивается на `/` или содержит недопустимые символы. |
Expand Down
1 change: 1 addition & 0 deletions docs/site/content/ru/components/hero.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Content-Security-Policy, описано на странице
| `effect` | строка | — | Имя фонового эффекта SIMAI Framework. |
| `effect_theme` | `auto`, `dark`, `light` | `auto` | Тема эффекта: по теме страницы, всегда тёмная или всегда светлая. |
| `effect_settings` | строка | — | Настройки эффекта в виде JSON. |
| `effect_narrow` | `hide`, `show` | `hide` | Эффект на экране уже 704 px: скрыт, потому что текст идёт во всю ширину Hero, или показан. |

<!-- docara:component-parameters:end -->

Expand Down
2 changes: 1 addition & 1 deletion docs/site/content/ru/reference/errors/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Front matter — блок между двумя строками `---` в нач
| `MARKDOWN_HERO_SIDE_IMAGE_CASE_MISMATCH`, `MARKDOWN_HERO_BACKGROUND_CASE_MISMATCH` | Регистр букв в пути не совпадает с именем файла. **Что сделать:** Исправьте путь. |
| `MARKDOWN_HERO_SIDE_IMAGE_CONTEXT_INVALID`, `MARKDOWN_HERO_BACKGROUND_CONTEXT_INVALID` | Картинку из `/assets/` использует файл вне `content/<язык>/`. **Что сделать:** Используйте hero на страницах в каталоге языка. |
| `MARKDOWN_HERO_EFFECT_INVALID` | `effect` — не имя эффекта из каталога и не адрес `https://.../effect.json`. **Что сделать:** Укажите имя эффекта, например `aurora-curtain`. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme` или `effect_settings` указаны без `effect`. **Что сделать:** Добавьте `effect` или уберите эти атрибуты. |
| `MARKDOWN_HERO_EFFECT_REQUIRED` | `effect_theme`, `effect_settings` или `effect_narrow` указаны без `effect`. **Что сделать:** Добавьте `effect` или уберите эти атрибуты. |
| `MARKDOWN_HERO_EFFECT_SETTINGS_INVALID` | `effect_settings` не является объектом JSON. **Что сделать:** Запишите настройки как `{"speed": 0.5}`. |
| `MARKDOWN_HERO_EFFECT_MEDIA_CONFLICT` | Одновременно фоновый эффект и фоновая картинка. **Что сделать:** Оставьте что-то одно. |

Expand Down
1 change: 1 addition & 0 deletions resources/component-catalog/descriptions/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"docara.hero.effect": "Имя фонового эффекта SIMAI Framework.",
"docara.hero.effect_theme": "Тема эффекта: по теме страницы, всегда тёмная или всегда светлая.",
"docara.hero.effect_settings": "Настройки эффекта в виде JSON.",
"docara.hero.effect_narrow": "Эффект на экране уже 704 px: скрыт, потому что текст идёт во всю ширину Hero, или показан.",
"docara.internal_preview.size": "Высота окна предпросмотра.",
"docara.internal_preview.title": "Название предпросмотра.",
"docara.logos.tone": "`muted` приглушает логотипы, чтобы они не спорили с основным содержимым.",
Expand Down
4 changes: 4 additions & 0 deletions resources/component-catalog/parameter-vocabulary.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@
"components": ["hero"],
"reason": "JSON settings passed to the background effect."
},
"effect_narrow": {
"components": ["hero"],
"reason": "Whether the background effect is drawn below md, where the hero text spans the block."
},
"display": {
"components": ["math"],
"reason": "Inline or block formula, the TeX term for the same choice."
Expand Down
6 changes: 3 additions & 3 deletions resources/component-catalog/source-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
},
{
"source_ref": "docs/site/content/ru/components/hero.md",
"source_sha256": "80094d6b3968052da1e042d7c640a826baf8f14315eb4ad2f0a9fc1d151bae7b",
"source_sha256": "9774a922129854ac0cbcd28310dde2fd3e4390096a57fceb2ecdc8972f79c5a0",
"release": "3.16.0",
"source_url": "https://github.com/simai/docara/blob/v3.16.0/docs/site/content/ru/components/hero.md",
"history_url": "https://github.com/simai/docara/commits/v3.16.0/docs/site/content/ru/components/hero.md",
Expand Down Expand Up @@ -454,7 +454,7 @@
},
{
"source_ref": "resources/component-catalog/typed/docara.hero.json",
"source_sha256": "401b919a62deb57d3934200f8951c02aaa7e566ee7318e659c4a738b963573a7",
"source_sha256": "3ae8932c5523aac55829bd1bb22b857d7b03d8c72a6489d9ffb3db84701d90ed",
"release": "3.16.0",
"source_url": "https://github.com/simai/docara/blob/v3.16.0/resources/component-catalog/typed/docara.hero.json",
"history_url": "https://github.com/simai/docara/commits/v3.16.0/resources/component-catalog/typed/docara.hero.json",
Expand Down Expand Up @@ -573,5 +573,5 @@
"history_exact": false
}
],
"content_sha256": "532ab62b4b8e19b2fc9e12fd79f87ed5ca722572dbc481fee655f3ddb9946ad9"
"content_sha256": "3be4454c4a71faad4f4fd8aa6eba3c5215e541af69157992d1cd90421d60d0a2"
}
3 changes: 2 additions & 1 deletion resources/component-catalog/typed/docara.hero.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
{"name": "overlay_strength", "type": "enum", "required": false, "default": "medium", "values": ["soft", "medium", "strong"], "available_when": {"media": "background"}},
{"name": "effect", "type": "string", "required": false},
{"name": "effect_theme", "type": "enum", "required": false, "default": "auto", "values": ["auto", "dark", "light"]},
{"name": "effect_settings", "type": "string", "required": false}
{"name": "effect_settings", "type": "string", "required": false},
{"name": "effect_narrow", "type": "enum", "required": false, "default": "hide", "values": ["hide", "show"]}
]
},
"states": [
Expand Down
Loading
Loading