Skip to content

Commit c40939d

Browse files
katiegoineskatiegoineshibler13heatheramz
authored
chore: update readme to reflect new IA (aws-amplify#6506)
* readme changes * Edits to readme * One small edit * Update Readme.md Co-authored-by: Heather Pundt <[email protected]> * Update Readme.md * Update Readme.md * Update Readme.md --------- Co-authored-by: katiegoines <[email protected]> Co-authored-by: Jim Eagan <[email protected]> Co-authored-by: Heather Pundt <[email protected]>
1 parent d1f5336 commit c40939d

File tree

1 file changed

+56
-16
lines changed

1 file changed

+56
-16
lines changed

Diff for: Readme.md

+56-16
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
We welcome contributions to the documentation site! Here's how to do it:
2222

23-
1. Follow our [styleguide](https://github.com/aws-amplify/docs/blob/main/STYLEGUIDE.md), especially if writing longer pieces.
23+
1. Follow our [style guide](https://github.com/aws-amplify/docs/blob/main/STYLEGUIDE.md), especially if writing longer pieces.
2424
2. Verify your changes locally.
2525
3. Make a PR to our `main` branch.
2626
1. Please include any [issues](https://github.com/aws-amplify/docs/issues) your PR addresses.
@@ -33,22 +33,60 @@ We welcome contributions to the documentation site! Here's how to do it:
3333
### Branches
3434

3535
- **main** - at parity with our production site [docs.amplify.aws](https://docs.amplify.aws/)
36-
- **gh-pages** - DO NOT DELETE! Handle redirects from v1 of the documentation site.
36+
- **gh-pages** - DO NOT DELETE!
3737

3838
## Authoring pages
3939

4040
Our docs are generated using [Next.js](https://nextjs.org/). Refer to their docs on [how to create pages](https://nextjs.org/docs/basic-features/pages) as a primer.
4141

42-
The pages' source are in **src**. This folder is the only directory you need to touch to edit or create pages.
42+
The source for each page is in **src**. This folder is the only directory you need to touch to edit or create pages.
4343

44-
Within this folder exists a **pages/index.tsx** file. This will be rendered as a page at the route **/**. Within the **pages/lib/q/platform/** folder is a **[platform].mdx** file, which will be rendered as a page at the route **/lib**.
44+
The **pages/index.tsx** file located inside this folder will be rendered as a page at the route **/**. The **pages/**/index.mdx** file will be rendered as a page at the route **/[platform]\*\*.
4545

46-
To have the page render properly and display in the sidebar, place your page and its route in **src/directory/directory.js**.
46+
To have the page render properly and display in the sidebar, place your page and its route in **src/directory/directory.mjs**.
4747

48-
IMPORTANT: Every page has to have a `title` and `description` meta field.
48+
IMPORTANT: Every page has to have a `title`, `description`, and `platforms` meta field and must import the `getCustomStaticPaths` util and export `getStaticPaths` and `getStaticProps` as shown in the example below:
49+
50+
```
51+
import { getCustomStaticPath } from '@/utils/getCustomStaticPath';
52+
53+
export const meta = {
54+
title: 'Add social provider sign-in',
55+
description:
56+
'Learn how to set up social sign-in providers like Facebook, Google, Amazon, or Sign in with Apple.',
57+
platforms: [
58+
'javascript',
59+
'react-native',
60+
'flutter',
61+
'swift',
62+
'android',
63+
'angular',
64+
'nextjs',
65+
'react',
66+
'vue'
67+
]
68+
};
69+
70+
export const getStaticPaths = async () => {
71+
return getCustomStaticPath(meta.platforms);
72+
};
73+
74+
export function getStaticProps(context) {
75+
return {
76+
props: {
77+
platform: context.params.platform,
78+
meta
79+
}
80+
};
81+
}
82+
```
4983

5084
The markdown body is parsed as [MDX](https://mdxjs.com/) and can include any valid HTML or JSX.
5185

86+
### Internal links
87+
88+
When linking to other pages within the docs.amplify.aws site, do not use relative links. For example, instead of `[here is my link](../manage-mfa/)`, use `[here is my link](/[platform]/build-a-backend/auth/manage-mfa/)`. Please note that when linking to a page with a pathname beginning with a platform—[platform] in the link—the URL will render conditionally based off the user's selected platform as a condition of the MDXLink component.
89+
5290
### Fragments
5391

5492
To incorporate new platform-specific content within a page, please use [Inline Filters](https://github.com/aws-amplify/docs/blob/main/Readme.md#inline-filters).
@@ -58,19 +96,21 @@ When editing content that hasn't been migrated, you may see the following patter
5896
```jsx
5997
import js from '/src/fragments/lib/datastore/js/conflict.mdx';
6098

61-
<Fragments fragments={{ javascript: js }} />;
99+
<Fragments
100+
fragments={{ javascript: js, angular: js, nextjs: js, react: js, vue: js }}
101+
/>;
62102
```
63103

64104
This pattern incorporates fragment files into a page and conditionally renders content based off selected platform added as a condition to the `Fragments` tag.
65105

66-
This fragment would exist in: `pages/src/fragments/lib/datastore/js/conflict.mdx`
106+
This fragment would exist in: `src/fragments/lib/datastore/js/conflict.mdx`
67107

68108
### Inline Filters
69109

70110
We are incorporating the use of `<InlineFilters>` to add platform-specific content within the context of one page rather than in fragments. These filters allow you to still specify content by platform and they reference platforms using the same naming convention as our fragments. You can enclose your platform-specific content by updating the opening tag:
71111

72112
```md
73-
<InlineFilter filters={["javascript", "react-native", "android", "swift", "flutter"]}>
113+
<InlineFilter filters={["javascript", "react-native", "angular", "nextjs", "react", "vue", "android", "swift", "flutter"]}>
74114

75115
</InlineFilter>
76116
```
@@ -79,7 +119,7 @@ If you are updating content on a page, please note any inline filter tags which
79119

80120
### Accordion
81121

82-
`Accordion` This single-use accordion hides peripheral content until the reader selects to expand the section. This helps you keep your pages focused on the need-to-know information upfront, while also providing readers an option to dive deeper when they choose. These accordions can provide peripheral content such as additional context for beginners, advanced deep dives for those who want to off-road, and troubleshooting guidance for errors users may encounter.
122+
`Accordion` This single-use accordion hides peripheral content until the reader selects to expand the section. This helps you keep your pages focused on the need-to-know information upfront, while also providing readers an option to dive deeper when they choose. These accordions can provide peripheral content such as additional context for beginners, advanced deep dives for those who want to off-road, and troubleshooting guidance for errors users may encounter.
83123

84124
Here is an example of its usage:
85125

@@ -88,9 +128,9 @@ Here is an example of its usage:
88128

89129
- Title – Make your title descriptive to help readers know what the accordion contains before they click.
90130
- Eyebrow – Update this text to reflect the purpose of the accordion. We recommend:
91-
- Learn more – used to add additional context that is not needed upfront but is useful for users to review when they choose.
92-
- Troubleshooting – used when adding details to troubleshoot specific errors within context.
93-
- Walkthrough – used when adding a step-by-step example for those who need more direct guidance.
131+
- Learn more – Used to add additional context that is not needed upfront but is useful for users to review when they choose.
132+
- Troubleshooting – Used when adding details to troubleshoot specific errors within context.
133+
- Walkthrough – Used when adding a step-by-step example for those who need more direct guidance.
94134

95135
</Accordion>
96136
```
@@ -143,15 +183,15 @@ let mut a = String::from("a");
143183
2. On your localhost page, go to the page with the React component you want to debug and open up the developer tools.
144184
3. To know which source file to breakpoint on, we need to find the name of the component first.
145185

146-
- Open up the dev tools and use the react dev tools to find the component. Do this by using the "Select an element on the page to inspect it" tool under the "Components" tab.
186+
- Open up the dev tools and use the React dev tools to find the component. Do this by using the "Select an element on the page to inspect it" tool under the "Components" tab.
147187

148188
- Search for the variable/component name inside the source code to find the file you want to debug.
149189

150190
- Place the breakpoint inside the file under the "Sources" tab in the browser's dev tools.
151-
- Note that since the Amplify Docs site is built with nextjs, file paths will start with "`webpack://_N_E/./`"
191+
- Note that since the Amplify Docs site is built with Next.js, file paths will start with "`webpack://_N_E/./`"
152192

153193
4. Refresh your localhost site and the breakpoint should hit in the browser's dev tools. You should be able to debug the code.
154194

155-
Another way to find which file you want to debug is to search for strings/paragraphs seen in Amplify docs site. Search for the strings in your code editor and you'll find that they will be in a `.mdx` file. You should see the components that are being rendered and be able to find the file name you want to debug.
195+
Another way to find which file you want to debug is to search for strings/paragraphs seen in the Amplify docs site. Search for the strings in your code editor and you'll find that they will be in a `.mdx` file. You should see the components that are being rendered and be able to find the file name you want to debug.
156196

157197
More info on debugging can be found here: https://nextjs.org/docs/advanced-features/debugging

0 commit comments

Comments
 (0)