Skip to content

Commit

Permalink
Разбирается с ориентирами страницы материала (#1183)
Browse files Browse the repository at this point in the history
* Возится с `<aside>`

* Добавляет подписи другим ориентирам
  • Loading branch information
TatianaFokina authored Aug 21, 2023
1 parent 6939efc commit a1c1ae6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/includes/blocks/linked-article.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{% macro linkedArticle(article, type = 'previous') %}
{% set icon = '' if type === 'previous' else '' %}

<aside class="linked-article linked-article--{{ type }}" style="--accent-color: var(--color-{{ article.section }})" aria-labelledby="article-{{ type }}">
<span class="visually-hidden" id="article-{{ type }}">{% if type === 'next' %}Следующий{% else %}Предыдущий{% endif %} материал</span>
<div class="linked-article linked-article--{{ type }}" style="--accent-color: var(--color-{{ article.section }})">
<div class="linked-article__icon font-theme font-theme--code" aria-hidden="true">
{{ icon }}
</div>
Expand All @@ -14,5 +13,5 @@
<kbd class="linked-article__hotkey hotkey">ctrl</kbd><span class="linked-article__hotkey hotkey linked-article__plus"> + </span><kbd class="linked-article__hotkey hotkey">alt</kbd><span class="linked-article__hotkey hotkey linked-article__plus"> + </span><kbd class="linked-article__hotkey hotkey">{{ icon }}</kbd>
</div>
</div>
</aside>
</div>
{% endmacro %}
4 changes: 2 additions & 2 deletions src/libs/heading-hierarchy/heading-hierarchy.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ function renderItem(item) {

function render(rootItem) {
return `
<div class="toc">
<aside class="toc" aria-label="Оглавление">
${renderItem(rootItem)}
</div>
</aside>
`
}

Expand Down
11 changes: 5 additions & 6 deletions src/views/doc.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="doc">
<main class="doc__main">
<article class="doc__article article {% if cover %}article--with-cover{% endif %}">
<header class="article__header">
<header class="article__header" aria-label="Материал">
<div class="article__header-inner doc__wrapper">
{% if cover %}
{{ articleImage(class="article__image", cover=cover, authors=populatedCoverAuthors) }}
Expand Down Expand Up @@ -72,7 +72,7 @@
<div class="article-nav__content"></div>
</div>

<footer class="article__meta">
<footer class="article__meta" aria-label="Авторы и дата публикации">
<div class="article__persons">
{% include "contributors.njk" %}
</div>
Expand Down Expand Up @@ -108,8 +108,7 @@
{% include "questions.njk" %}
</div>

<aside class="doc__feedback-form" aria-labelledby="feedback">
<span class="visually-hidden" id="feedback">Оценка материала</span>
<aside class="doc__feedback-form" aria-label="Оценка материала">
{% include "feedback-form.njk" %}
</aside>

Expand All @@ -120,15 +119,15 @@
{% endif %}

{% if (previousArticle or nextArticle) %}
<div class="doc__linked-articles">
<aside class="doc__linked-articles" aria-label="Полезные материалы">
{% if previousArticle %}
{{ linkedArticle(article=previousArticle, type="previous") }}
{% endif %}

{% if nextArticle %}
{{ linkedArticle(article=nextArticle, type="next") }}
{% endif %}
</div>
</aside>
{% endif %}
</div>
</div>
Expand Down

0 comments on commit a1c1ae6

Please sign in to comment.