mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Improve accessibility (#597)
This commit is contained in:
parent
e9a1268c0d
commit
aa6da25f89
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
|
||||
<div class="site-nav-right">
|
||||
<div class="toggle popup-trigger">
|
||||
<div class="toggle popup-trigger" aria-label="{{ __('menu.search') }}" role="button">
|
||||
{%- if theme.algolia_search.enable or theme.local_search.enable %}
|
||||
<i class="fa fa-search fa-fw fa-lg"></i>
|
||||
{%- endif %}
|
||||
|
||||
@ -1,12 +1,5 @@
|
||||
{%- if page.prev or page.next %}
|
||||
<nav class="pagination">
|
||||
{{
|
||||
paginator({
|
||||
prev_text: '<i class="fa fa-angle-left" aria-label="' + __('accessibility.prev_page') + '"></i>',
|
||||
next_text: '<i class="fa fa-angle-right" aria-label="' + __('accessibility.next_page') + '"></i>',
|
||||
mid_size : 1,
|
||||
escape : false
|
||||
})
|
||||
}}
|
||||
{{ next_paginator() }}
|
||||
</nav>
|
||||
{%- endif %}
|
||||
|
||||
18
scripts/helpers/next-paginator.js
Normal file
18
scripts/helpers/next-paginator.js
Normal file
@ -0,0 +1,18 @@
|
||||
/* global hexo */
|
||||
|
||||
'use strict';
|
||||
|
||||
hexo.extend.helper.register('next_paginator', function() {
|
||||
const prev = this.__('accessibility.prev_page');
|
||||
const next = this.__('accessibility.next_page');
|
||||
let paginator = this.paginator({
|
||||
prev_text: '<i class="fa fa-angle-left"></i>',
|
||||
next_text: '<i class="fa fa-angle-right"></i>',
|
||||
mid_size : 1,
|
||||
escape : false
|
||||
});
|
||||
paginator = paginator
|
||||
.replace('rel="prev"', `rel="prev" title="${prev}" aria-label="${prev}"`)
|
||||
.replace('rel="next"', `rel="next" title="${next}" aria-label="${next}"`);
|
||||
return paginator;
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user