mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Fix tab selection of disabled items in internal pagination template
This commit is contained in:
parent
e31b1d1946
commit
f75f90079a
3 changed files with 9 additions and 9 deletions
|
@ -152,7 +152,7 @@ func TestEmbeddedPaginationTemplate(t *testing.T) {
|
|||
b.AssertFileContent("public/index.html", expectedOutput)
|
||||
}
|
||||
|
||||
expectedOutputDefaultFormat := "Pager 1\n <ul class=\"pagination pagination-default\">\n <li class=\"page-item disabled\">\n <a href=\"#\" aria-disabled=\"true\" aria-label=\"First\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">««</span></a>\n </li>\n <li class=\"page-item disabled\">\n <a href=\"#\" aria-disabled=\"true\" aria-label=\"Previous\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">«</span></a>\n </li>\n <li class=\"page-item active\">\n <a href=\"#\" aria-current=\"page\" aria-label=\"Page 1\" class=\"page-link\" role=\"button\">1</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Page 2\" class=\"page-link\" role=\"button\">2</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/3/\" aria-label=\"Page 3\" class=\"page-link\" role=\"button\">3</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/4/\" aria-label=\"Page 4\" class=\"page-link\" role=\"button\">4</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/5/\" aria-label=\"Page 5\" class=\"page-link\" role=\"button\">5</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Next\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»</span></a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/10/\" aria-label=\"Last\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»»</span></a>\n </li>\n </ul>"
|
||||
expectedOutputDefaultFormat := "Pager 1\n <ul class=\"pagination pagination-default\">\n <li class=\"page-item disabled\">\n <a href=\"#\" aria-disabled=\"true\" aria-label=\"First\" class=\"page-link\" role=\"button\" tabindex=\"-1\"><span aria-hidden=\"true\">««</span></a>\n </li>\n <li class=\"page-item disabled\">\n <a href=\"#\" aria-disabled=\"true\" aria-label=\"Previous\" class=\"page-link\" role=\"button\" tabindex=\"-1\"><span aria-hidden=\"true\">«</span></a>\n </li>\n <li class=\"page-item active\">\n <a href=\"#\" aria-current=\"page\" aria-label=\"Page 1\" class=\"page-link\" role=\"button\">1</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Page 2\" class=\"page-link\" role=\"button\">2</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/3/\" aria-label=\"Page 3\" class=\"page-link\" role=\"button\">3</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/4/\" aria-label=\"Page 4\" class=\"page-link\" role=\"button\">4</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/5/\" aria-label=\"Page 5\" class=\"page-link\" role=\"button\">5</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Next\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»</span></a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/10/\" aria-label=\"Last\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»»</span></a>\n </li>\n </ul>"
|
||||
expectedOutputTerseFormat := "Pager 1\n <ul class=\"pagination pagination-terse\">\n <li class=\"page-item active\">\n <a href=\"#\" aria-current=\"page\" aria-label=\"Page 1\" class=\"page-link\" role=\"button\">1</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Page 2\" class=\"page-link\" role=\"button\">2</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/3/\" aria-label=\"Page 3\" class=\"page-link\" role=\"button\">3</a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/2/\" aria-label=\"Next\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»</span></a>\n </li>\n <li class=\"page-item\">\n <a href=\"/page/10/\" aria-label=\"Last\" class=\"page-link\" role=\"button\"><span aria-hidden=\"true\">»»</span></a>\n </li>\n </ul>"
|
||||
|
||||
variant := `{{ template "_internal/pagination.html" . }}`
|
||||
|
|
8
tpl/tplimpl/embedded/templates.autogen.go
generated
8
tpl/tplimpl/embedded/templates.autogen.go
generated
|
@ -290,7 +290,7 @@ if (!doNotTrack) {
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="First" class="page-link" role="button"><span aria-hidden="true">««</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">««</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
@ -301,7 +301,7 @@ if (!doNotTrack) {
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
|
@ -330,7 +330,7 @@ if (!doNotTrack) {
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
|
@ -341,7 +341,7 @@ if (!doNotTrack) {
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»»</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="First" class="page-link" role="button"><span aria-hidden="true">««</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="First" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">««</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
@ -51,7 +51,7 @@
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Previous" class="page-link" role="button"><span aria-hidden="true">«</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Previous" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">«</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Next" class="page-link" role="button"><span aria-hidden="true">»</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Next" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
</li>
|
||||
{{- else }}
|
||||
<li class="page-item disabled">
|
||||
<a href="#" aria-disabled="true" aria-label="Last" class="page-link" role="button"><span aria-hidden="true">»»</span></a>
|
||||
<a href="#" aria-disabled="true" aria-label="Last" class="page-link" role="button" tabindex="-1"><span aria-hidden="true">»»</span></a>
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue