Skip to content

Commit

Permalink
feat($theme-default): more semantic HTML (close: #1154)(#1156)
Browse files Browse the repository at this point in the history
By replacing some `div`s with `header`/`main`/`aside` tags
and adding an aria landmark to the search
  • Loading branch information
HerrBertling authored and ulivz committed Jan 8, 2019
1 parent 87894ff commit ede57b0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<form
id="search-form"
class="algolia-search-wrapper search-box"
role="search"
>
<input
id="algolia-search-input"
Expand Down
9 changes: 5 additions & 4 deletions packages/@vuepress/theme-default/components/Home.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div class="home">
<div class="hero">
<main class="home" aria-labelledby="main-title">
<header class="hero">
<img
v-if="data.heroImage"
:src="$withBase(data.heroImage)"
alt="hero"
>

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

<p class="description">
{{ data.tagline || $description || 'Welcome to your VuePress site' }}
Expand All @@ -22,7 +22,7 @@
:item="actionLink"
/>
</p>
</div>
</header>

<div
class="features"
Expand Down Expand Up @@ -75,6 +75,7 @@ export default {
padding $navbarHeight 2rem 0
max-width 960px
margin 0px auto
display block
.hero
text-align center
img
Expand Down
9 changes: 5 additions & 4 deletions packages/@vuepress/theme-default/components/Page.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="page">
<main class="page">
<slot name="top"/>

<Content/>

<div class="page-edit">
<footer class="page-edit">
<div
class="edit-link"
v-if="editLink"
Expand All @@ -24,7 +24,7 @@
<span class="prefix">{{ lastUpdatedText }}: </span>
<span class="time">{{ lastUpdated }}</span>
</div>
</div>
</footer>

<div class="page-nav" v-if="prev || next">
<p class="inner">
Expand Down Expand Up @@ -58,7 +58,7 @@
</div>

<slot name="bottom"/>
</div>
</main>
</template>

<script>
Expand Down Expand Up @@ -197,6 +197,7 @@ function find (page, items, offset) {
.page
padding-bottom 2rem
display block
.page-edit
@extend $wrapper
Expand Down
4 changes: 2 additions & 2 deletions packages/@vuepress/theme-default/components/Sidebar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="sidebar">
<aside class="sidebar">
<NavLinks/>
<slot name="top"/>
<ul class="sidebar-links" v-if="items.length">
Expand All @@ -16,7 +16,7 @@
</li>
</ul>
<slot name="bottom"/>
</div>
</aside>
</template>

<script>
Expand Down
4 changes: 2 additions & 2 deletions packages/@vuepress/theme-default/components/SidebarGroup.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div
<section
class="sidebar-group"
:class="{ first, collapsable }"
>
Expand Down Expand Up @@ -27,7 +27,7 @@
</li>
</ul>
</DropdownTransition>
</div>
</section>
</template>

<script>
Expand Down

0 comments on commit ede57b0

Please sign in to comment.