Skip to content

Commit e5fbf92

Browse files
authored
Merge pull request #247 from wpengine/fix/add-alt-text-to-images
Fix: Add alt-text to images and fix mdx-components.jsx file
2 parents b3ba7a1 + fc6c2b8 commit e5fbf92

File tree

14 files changed

+19
-15
lines changed

14 files changed

+19
-15
lines changed

mdx-components.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ import CustomLink from "@/components/link";
55

66
export function useMDXComponents(components) {
77
return {
8-
img: ({ src }, ...props) => (
8+
img: ({ src, alt }, ...props) => (
99
<Image
10-
alt={props.alt}
10+
alt={alt}
1111
blurDataURL={src.blurDataURL}
1212
height={src.height}
1313
placeholder="blur"
1414
src={src.src}
1515
style={{ width: "100%", height: "auto" }}
1616
width={src.width}
17+
{...props}
1718
/>
1819
),
1920
a: (props) => <CustomLink {...props} />,

src/pages/docs/how-to/authentication/images/auth-redirect-flow-2048x989-3.png renamed to src/pages/docs/how-to/authentication/images/auth-redirect-flow.png

File renamed without changes.

src/pages/docs/how-to/authentication/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Before starting, it helps to break down the process into three concepts:
1414

1515
This diagram shows the authentication flow using the Faust.js toolkit auth feature:
1616

17-
![](./images/auth-redirect-flow-2048x989-3.png)
17+
![Flow diagram illustrating authentication flow](./images/auth-redirect-flow.png)
1818

1919
Redirect-based authentication is the default strategy in the Faust.js toolkit. This strategy involves redirecting the user to WordPress to authenticate. Once the user has shown authentication, the user redirects back to the Next.js application with an authorization code, which you can then use to request a refresh and access token, thus completing the login process.
2020

src/pages/docs/how-to/basic-setup/images/headless-admin-secret-1024x743.png renamed to src/pages/docs/how-to/basic-setup/images/headless-admin-secret.png

File renamed without changes.

src/pages/docs/how-to/basic-setup/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Replace `https://faustexample.wpengine.com` with the URL for your WordPress back
3232

3333
Replace `YOUR_PLUGIN_SECRET` with the Secret Key found in `Settings → Faust` in your WordPress admin area.
3434

35-
![](./images/headless-admin-secret-1024x743.png)
35+
![Screenshot of the Headless Settings page in the WordPress admin panel, showing the Faust plugin settings. The Secret Key field is highlighted, which is required to enable authentication features like post previews in Faust.js.](./images/headless-admin-secret.png)
3636

3737
Save your `.env.local` file.
3838

src/pages/docs/how-to/generate-types-with-graphql-codegen/index.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,13 @@ export const pageQuery = gql(/* GraphQL */ `
101101

102102
Then you can inspect all the types in the `props` parameters as you type:
103103

104-
![](./images/ts-image-one.png)
104+
![TypeScript auto-complete suggestion in Faust.js, showing the available fields for a GraphQL query's response. The code completion suggests properties like `__SEED_NODE__`, `data`, and `loading`, indicating TypeScript's type inference for the `props` object.
105+
](./images/ts-image-one.png)
105106

106107
All the data from the query results will be properly typed based on the introspected schema:
107108

108-
![](./images/ts-image-two.png)
109+
![TypeScript type definition for an author field in a Faust.js GraphQL query. The type structure shows `NodeWithAuthorToUserConnectionEdge`, defining the `User` type with an optional `name` property, demonstrating TypeScript's type safety for GraphQL responses.
110+
](./images/ts-image-two.png)
109111

110112
### B. Typing Block Components
111113

src/pages/docs/how-to/post-previews/images/post-preview-frontend-1024x806-1.png renamed to src/pages/docs/how-to/post-previews/images/post-preview-frontend.png

File renamed without changes.

src/pages/docs/how-to/post-previews/images/post-preview-1024x806-1.png renamed to src/pages/docs/how-to/post-previews/images/post-preview.png

File renamed without changes.

src/pages/docs/how-to/post-previews/index.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,11 @@ Start by logging into your WordPress Admin. For this example, we'll create a new
112112
113113
So far, I've added a title and a simple line of text for the content. To view this post as a preview on your front end, click the `Preview` link (1). From there, click, `Preview in new tab` (2):
114114
115-
![](./images/post-preview-1024x806-1.png)
115+
![WordPress editor with a draft post titled 'My Post' and a simple text block for post content. The Preview dropdown menu is open, showing options to preview the post on Desktop, Tablet, and Mobile, along with a 'Preview in new tab' option highlighted.
116+
](./images/post-preview.png)
116117
117118
Notice that the `Publish` button is also visible, meaning that you still need to publish the post. Therefore, you can now view the post on the frontend without being authenticated.
118119
119120
Clicking on `Preview in new tab` should take you to your post preview page with the current preview content:
120121
121-
![](./images/post-preview-frontend-1024x806-1.png)
122+
![Frontend preview of a WordPress post in a Faust.js headless setup. The page displays 'My Post' as the title with preview content below. The preview URL includes `?preview=true`, indicating that the user is viewing an unpublished draft.](./images/post-preview-frontend.png)

src/pages/docs/how-to/rendering-blocks/images/Screenshot-2024-10-08-at-10.10.31-AM.png renamed to src/pages/docs/how-to/rendering-blocks/images/graphqlide-block.png

File renamed without changes.

0 commit comments

Comments
 (0)