️ Fix menus accessibility

This commit is contained in:
Kazhnuz 2025-08-22 23:54:43 +02:00
parent 3eaca33170
commit 1a4264346a
8 changed files with 21 additions and 21 deletions

View file

@ -41,12 +41,12 @@ class pluginArchives extends Plugin
$filter = $url->filters('archive');
$html = '<div class="plugin plugin-archives">';
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
$html = '<nav class="plugin plugin-archives" aria-labelledby="plugin-archives-title">';
$html .= '<h2 class="plugin-label" id="plugin-archives-title">' . $this->getValue('label') . '</h2>';
$html .= '<div class="plugin-content">';
$html .= MenuHelper::getArchive($this->getValue('monthly'), "flat-list");
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -41,12 +41,12 @@ class pluginCategories extends Plugin
global $categories;
// HTML for sidebar
$html = '<div class="plugin plugin-categories">';
$html = '<nav class="plugin plugin-categories">';
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
$html .= '<div class="plugin-content">';
$html .= MenuHelper::getCategories($this->getValue('hideCero'), true);
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -41,7 +41,7 @@ class pluginLastArticles extends Plugin
global $pages;
// HTML for sidebar
$html = '<div class="plugin plugin-lastarticles">';
$html = '<nav class="plugin plugin-lastarticles">';
// Print the label if not empty
$label = $this->getValue('label');
@ -52,7 +52,7 @@ class pluginLastArticles extends Plugin
$html .= '<div class="plugin-content">';
$html .= MenuHelper::getArticles($this->getValue('numberOfItems'), false);
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -44,7 +44,7 @@ class pluginNavigation extends Plugin
global $pages;
// HTML for sidebar
$html = '<div class="plugin plugin-navigation">';
$html = '<nav class="plugin plugin-navigation">';
// Print the label if not empty
$label = $this->getValue('label');
@ -84,7 +84,7 @@ class pluginNavigation extends Plugin
$html .= '</ul>';
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -44,7 +44,7 @@ class pluginStaticPages extends Plugin
global $pages;
// HTML for sidebar
$html = '<div class="plugin plugin-static-pages">';
$html = '<nav class="plugin plugin-static-pages">';
// Print the label if not empty
$label = $this->getValue('label');
@ -55,7 +55,7 @@ class pluginStaticPages extends Plugin
$html .= '<div class="plugin-content">';
$html .= MenuHelper::getStatics(-1, $this->getValue('homeLink'));
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -31,12 +31,12 @@ class pluginTags extends Plugin
$filter = $url->filters('tag');
$html = '<div class="plugin plugin-tags">';
$html = '<nav class="plugin plugin-tags">';
$html .= '<h2 class="plugin-label">' . $this->getValue('label') . '</h2>';
$html .= '<div class="plugin-content">';
$html .= MenuHelper::getTags(1, "flat-list");
$html .= '</div>';
$html .= '</div>';
$html .= '</nav>';
return $html;
}

View file

@ -136,28 +136,28 @@ aside {
}
}
nav ul {
header#main-header nav ul {
display: flex;
flex-wrap: wrap;
padding: .5rem 0;
}
nav ul li {
header#main-header nav ul li {
list-style-type: none;
margin: 0
}
nav ul li a,
nav ul li span {
header#main-header nav ul li a,
header#main-header nav ul li span {
padding: .5rem
}
nav ul li.separator {
header#main-header nav ul li.separator {
margin-right: auto
}
nav ul li.separator-left {
header#main-header nav ul li.separator-left {
margin-left: auto
}

View file

@ -1,5 +1,5 @@
<header id="main-header">
<nav><?php echo MenuHelper::getStatics(6, true, "", "", "active", '<li class="separator-left"><a href="'.Theme::siteUrl().'rss.xml">RSS</a></li>'); ?></nav>
<nav aria-label="<?php $language->p('Pages') ?>"><?php echo MenuHelper::getStatics(6, true, "", "", "active", '<li class="separator-left"><a href="'.Theme::siteUrl().'rss.xml">RSS</a></li>'); ?></nav>
<hgroup id="title-container">
<?php $logo = MediaHelper::getLogo(); ?>
<?php if ($logo) : ?>
@ -9,5 +9,5 @@
<p><?php echo $site->description() ?></p>
<?php endif ?>
</hgroup>
<nav><?php echo MenuHelper::getCategories(true, false); ?></nav>
<nav aria-label="<?php $language->p('Categories') ?>"><?php echo MenuHelper::getCategories(true, false); ?></nav>
</header>