Skip to content

Commit ede57b0

Browse files
HerrBertlingulivz
authored andcommitted
feat($theme-default): more semantic HTML (close: #1154)(#1156)
By replacing some `div`s with `header`/`main`/`aside` tags and adding an aria landmark to the search
1 parent 87894ff commit ede57b0

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<form
33
id="search-form"
44
class="algolia-search-wrapper search-box"
5+
role="search"
56
>
67
<input
78
id="algolia-search-input"

packages/@vuepress/theme-default/components/Home.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div class="home">
3-
<div class="hero">
2+
<main class="home" aria-labelledby="main-title">
3+
<header class="hero">
44
<img
55
v-if="data.heroImage"
66
:src="$withBase(data.heroImage)"
77
alt="hero"
88
>
99

10-
<h1>{{ data.heroText || $title || 'Hello' }}</h1>
10+
<h1 id="main-title">{{ data.heroText || $title || 'Hello' }}</h1>
1111

1212
<p class="description">
1313
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
@@ -22,7 +22,7 @@
2222
:item="actionLink"
2323
/>
2424
</p>
25-
</div>
25+
</header>
2626

2727
<div
2828
class="features"
@@ -75,6 +75,7 @@ export default {
7575
padding $navbarHeight 2rem 0
7676
max-width 960px
7777
margin 0px auto
78+
display block
7879
.hero
7980
text-align center
8081
img

packages/@vuepress/theme-default/components/Page.vue

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<template>
2-
<div class="page">
2+
<main class="page">
33
<slot name="top"/>
44

55
<Content/>
66

7-
<div class="page-edit">
7+
<footer class="page-edit">
88
<div
99
class="edit-link"
1010
v-if="editLink"
@@ -24,7 +24,7 @@
2424
<span class="prefix">{{ lastUpdatedText }}: </span>
2525
<span class="time">{{ lastUpdated }}</span>
2626
</div>
27-
</div>
27+
</footer>
2828

2929
<div class="page-nav" v-if="prev || next">
3030
<p class="inner">
@@ -58,7 +58,7 @@
5858
</div>
5959

6060
<slot name="bottom"/>
61-
</div>
61+
</main>
6262
</template>
6363

6464
<script>
@@ -197,6 +197,7 @@ function find (page, items, offset) {
197197
198198
.page
199199
padding-bottom 2rem
200+
display block
200201
201202
.page-edit
202203
@extend $wrapper

packages/@vuepress/theme-default/components/Sidebar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="sidebar">
2+
<aside class="sidebar">
33
<NavLinks/>
44
<slot name="top"/>
55
<ul class="sidebar-links" v-if="items.length">
@@ -16,7 +16,7 @@
1616
</li>
1717
</ul>
1818
<slot name="bottom"/>
19-
</div>
19+
</aside>
2020
</template>
2121

2222
<script>

packages/@vuepress/theme-default/components/SidebarGroup.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div
2+
<section
33
class="sidebar-group"
44
:class="{ first, collapsable }"
55
>
@@ -27,7 +27,7 @@
2727
</li>
2828
</ul>
2929
</DropdownTransition>
30-
</div>
30+
</section>
3131
</template>
3232

3333
<script>

0 commit comments

Comments
 (0)