Skip to content

Commit 8c0a1ba

Browse files
committed
update & delete file
1 parent 15b93ce commit 8c0a1ba

File tree

290 files changed

+87685
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+87685
-963
lines changed

.eslintrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
env: {
3+
commonjs: true,
4+
node: true,
5+
},
6+
}

README.md

+1-41
Original file line numberDiff line numberDiff line change
@@ -1,41 +1 @@
1-
# pando-blog
2-
3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4-
5-
### Installation
6-
7-
```
8-
$ yarn
9-
```
10-
11-
### Local Development
12-
13-
```
14-
$ yarn start
15-
```
16-
17-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18-
19-
### Build
20-
21-
```
22-
$ yarn build
23-
```
24-
25-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26-
27-
### Deployment
28-
29-
Using SSH:
30-
31-
```
32-
$ USE_SSH=true yarn deploy
33-
```
34-
35-
Not using SSH:
36-
37-
```
38-
$ GIT_USER=<Your GitHub username> yarn deploy
39-
```
40-
41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
1+
# Pando Docs

README.md.example

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# RedwoodJS Docs
2+
3+
Deployment URL: https://redwoodjs.com/docs
4+
5+
## Getting started
6+
7+
Checkout this repo [(redwoodjs/redwood)](https://github.com/redwoodjs/redwood), `cd` into this directory (`docs`)
8+
9+
```
10+
yarn install
11+
12+
yarn start
13+
```
14+
15+
#### Making Changes
16+
17+
Changes should be made in the `./docs` directory and not in the generated `./versioned_docs` or `./versioned_sidebars` directories directly.
18+
19+
After running `yarn start`, you should be able to see your changes in the local [Canary Version](http://localhost:3000/docs/canary/index).
20+
21+
#### Internal linking
22+
23+
For links to other docs inside the `tutorials` directory you need to use *relative* links.
24+
25+
```
26+
In [previous section](./first-page) we....
27+
```
28+
29+
## Contributing
30+
31+
Fork the repo, make your changes and open a PR on GitHub. That will build and launch a copy of the site that you can get from the `netlify/redwoodjs/deploy-preview` check (click "Details" to open it):
32+
33+
![image](https://user-images.githubusercontent.com/300/76569613-c4421000-6470-11ea-8223-eb98504e6994.png)
34+
35+
Double check that your changes look good!
36+
37+
### Updating Doc Images
38+
To update any images in the doc, first upload your screenshot into a comment textbox in your PR. Once it's uploaded, you can open the image in a new tab and use the github url as a image link in your docs.
39+
40+
## Contributors
41+
42+
Redwood is amazing thanks to a wonderful [community of contributors](https://github.com/redwoodjs/redwood/blob/main/README.md#contributors).

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
22
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3-
};
3+
}

blog/2019-05-28-first-blog-post.md

-12
This file was deleted.

blog/2019-05-29-long-blog-post.md

-44
This file was deleted.

blog/2021-08-01-mdx-blog-post.mdx

-20
This file was deleted.
Binary file not shown.

blog/2021-08-26-welcome/index.md

-25
This file was deleted.

blog/authors.yml

-17
This file was deleted.

docs/a11y.md

+170
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
slug: accessibility
3+
description: Accessibility is a core feature that's built-in
4+
---
5+
6+
# Accessibility (aka a11y)
7+
8+
We built Redwood to make building websites more accessible (we write all the config so you don't have to), but Redwood's also built to help you make more accessible websites.
9+
Accessibility shouldn't be a nice-to-have.
10+
It should be a given from the start.
11+
A core feature that's built-in and well-supported.
12+
13+
There's a lot of great tooling out there that'll not only help you build accessible websites, but also help you learn exactly what that means.
14+
15+
> **Does tooling obviate the need for manual testing?**
16+
>
17+
> No—even with all the tooling in the world, manual testing is still important, especially for accessibility.
18+
> But just because tooling doesn't catch everything doesn't mean it's not valuable.
19+
> It'd be much harder to learn what to look for without it.
20+
21+
## Accessible Routing
22+
23+
For single-page applications (SPAs), accessibility starts with the router.
24+
Without a full-page refresh, you just can't be sure that things like announcements and focus are being taken care of the way they're supposed to be.
25+
Here's a great example of [how disorienting SPAs can be to screen-reader users](https://www.youtube.com/watch?v=NKTdNv8JpuM).
26+
On navigation, nothing's announced.
27+
The lack of an announcement isn't just buggy behavior—it's broken.
28+
29+
Normally, the onus would be on you as a developer to announce to screen-reader users that they've navigated somewhere new.
30+
That's a lot to ask—and hard to get right—especially when you're just trying to build your app.
31+
32+
Luckily, if you're writing thoughtful content and marking it up semantically, there's nothing you have to do!
33+
The router automatically announces pages on navigation, and looks for announcements in this order:
34+
35+
1. The `RouteAnnouncement` component
36+
2. The page's `<h1>`
37+
3. `document.title`
38+
4. `location.pathname`
39+
40+
The reason for this order is that announcements should be as specific as possible.
41+
more specific usually means more descriptive, and more descriptive usually means that users can not only orient themselves and navigate through the content, but also find it again.
42+
43+
> If you're not sure if your content is descriptive enough, see the [W3 guidelines](https://www.w3.org/WAI/WCAG21/Techniques/general/G88.html).
44+
45+
Even though Redwood looks for a `RouteAnnouncement` component first, you don't have to have one on every page—it's more than ok for the `<h1>` to be what's announced.
46+
`RouteAnnouncement` is there for when the situation calls for a custom announcement.
47+
48+
### `RouteAnnouncement`
49+
50+
The way `RouteAnnouncement` works is simple: its children will be announced.
51+
Note that this can be something on the page or can be something that's visually hidden using the `visuallyHidden` prop:
52+
53+
```jsx title="web/src/pages/HomePage/HomePage.js"
54+
import { RouteAnnouncement } from '@redwoodjs/router'
55+
56+
const HomePage = () => {
57+
return (
58+
// This will still be visible
59+
<RouteAnnouncement>
60+
<h1>Welcome to my site!</h1>
61+
</RouteAnnouncement>
62+
)
63+
}
64+
65+
export default HomePage
66+
```
67+
68+
```jsx title="web/src/pages/AboutPage/AboutPage.js"
69+
import { RouteAnnouncement } from '@redwoodjs/router'
70+
71+
const AboutPage = () => {
72+
return (
73+
<h1>Welcome to my site!</h1>
74+
// This won't be visible
75+
// highlight-start
76+
<RouteAnnouncement visuallyHidden>
77+
All about me
78+
</RouteAnnouncement>
79+
// highlight-end
80+
)
81+
}
82+
83+
export default AboutPage
84+
```
85+
86+
`visuallyHidden` shouldn't be the first thing you reach for—it's good to maintain parity between your site's visual and audible experiences.
87+
But it's there if you need it.
88+
89+
## Focus
90+
91+
On page change, Redwood Router resets focus to the top of the DOM so that users can navigate through the new page.
92+
While this is the expected behavior (and the behavior you usually want), for some pages—especially those with a lot of navigation—it can be cumbersome for users to have tab through navigation before getting to the main point.
93+
(And that goes for every page change!)
94+
95+
Right now, there's two ways to alleviate this: with skip links or the `RouteFocus` component.
96+
97+
### Skip Links
98+
99+
Since the main content isn't usually the first thing on the page, it's a best practice to provide a shortcut for keyboard and screen-reader users to skip to it.
100+
Skip links do just that, and if you generate a layout using the `--skipLink` option, you'll get one with a skip link:
101+
102+
```
103+
yarn rw g layout main --skipLink
104+
```
105+
106+
```jsx title="web/src/layouts/MainLayout/MainLayout.js"
107+
import { SkipNavLink, SkipNavContent } from '@redwoodjs/router'
108+
import '@reach/skip-nav/styles.css'
109+
110+
const MainLayout = ({ children }) => {
111+
return (
112+
<>
113+
<SkipNavLink />
114+
<nav></nav>
115+
<SkipNavContent />
116+
<main>{children}</main>
117+
</>
118+
)
119+
}
120+
121+
export default MainLayout
122+
```
123+
124+
`SkipNavLink` renders a link that remains hidden till focused and `SkipNavContent` renders a div as the target for the link.
125+
For more on these components, see [Reach UI's docs](https://reach.tech/skip-nav/#reach-skip-nav).
126+
127+
One thing you'll probably want to do is change the URL the skip link sends the user to when activated.
128+
You can do that by changing the `contentId` and `id` props of `SkipNavLink` and `SkipNavContent` respectively:
129+
130+
```jsx
131+
<SkipNavLink contentId="main-content" />
132+
{/* ... */}
133+
<SkipNavContent id="main-content" />
134+
```
135+
136+
If you'd prefer to implement your own skip link, [Ben Myers' blog](https://benmyers.dev/blog/skip-links/) is a great resource, and a great place to read about accessibility in general.
137+
138+
### `RouteFocus`
139+
140+
Sometimes you don't want to just skip the nav, but send a user somewhere.
141+
In this situation, you of course have the foresight that that place is where the user wants to be.
142+
So please use this at your discretion—sending a user to an unexpected location can be worse than sending them back the top.
143+
144+
Having said that, if you know that on a particular page change a user's focus is better off being directed to a particular element, the `RouteFocus` component is what you want:
145+
146+
```jsx title="web/src/pages/ContactPage/ContactPage.js"
147+
// highlight-next-line
148+
import { RouteFocus } from '@redwoodjs/router'
149+
150+
const ContactPage = () => (
151+
<nav>
152+
{/* Way too much nav... */}
153+
</nav>
154+
155+
// The contact form the user actually wants to interact with
156+
// highlight-start
157+
<RouteFocus>
158+
<TextField name="name" />
159+
</RouteFocus>
160+
// highlight-end
161+
)
162+
163+
export default ContactPage
164+
```
165+
166+
`RouteFocus` tells the router to send focus to it's child on page change. In the example above, when the user navigates to the contact page, the name text field on the form is focused—the first field of the form they're here to fill out.
167+
168+
<div class="video-container">
169+
<iframe src="https://www.youtube.com/embed/T1zs77LU68w?t=3240" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; modestbranding; showinfo=0; fullscreen"></iframe>
170+
</div>

0 commit comments

Comments
 (0)