Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix previous and next links in the getting started section #766

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/Changelogs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ import SystemChangelog from "../../../ui-system/CHANGELOG.md?raw";
<Unstyled>
<div className="mt-4" />
</Unstyled>
<Navigators leftLink="Release Tags" />
<Navigators leftLabel="Release Tags" />
</div>
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/Configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ import codeBlocks from "../helpers/codeBlocks";
/>
</div>

<Navigators leftLink="Installation" rightLink="Usage" />
<Navigators leftLabel="Installation" rightLabel="Usage" />

</div>
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/Installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ import tableData from "../helpers/tableData";
</small>
</p>

<Navigators leftLink="Overview" rightLink="Configuration" />
<Navigators leftLabel="Overview" rightLabel="Configuration" />

</div>
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/Overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Navigators from "../helpers/Navigators";
</div>
<div className="p-4">
<blockquote>The UI Components Library provides a strong, responsive, and accessible set of foundational React components.</blockquote>
<Navigators rightLink="Installation" />
<Navigators rightLabel="Installation" />
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/ReleaseTags.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ import Navigators from "../helpers/Navigators";
</ul>

<div className="mt-8">
<Navigators leftLink="Usage" rightLink="Changelogs" />
<Navigators leftLabel="Usage" rightLabel="Changelogs" />
</div>

</div>
2 changes: 1 addition & 1 deletion packages/api/src/getting-started/Usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ import codeBlocks from "../helpers/codeBlocks";
<p>Hello World</p>
</Card>

<Navigators leftLink="Configuration" rightLink="Release Tags" paddingTop />
<Navigators leftLabel="Configuration" rightLabel="Release Tags" paddingTop />

</div>
15 changes: 15 additions & 0 deletions packages/api/src/helpers/Navigators.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ export default ({
| "space-evenly"
| undefined = "flex-end";

/**
* If the label is provided but the link is not, we generate the link from the label,
* by replacing spaces with dashes and converting to lowercase, and adding "--docs" at the end,
* and getting-started- at the beginning.
* Example: "Release Tags" -> "getting-started-release-tags--docs"
*
* This is the default for the main "getting started" pages.
*/
if (leftLabel && !leftLink) {
leftLink = `getting-started-${leftLabel.replace(/\s+/g, "-").toLowerCase()}--docs`;
}
if (rightLabel && !rightLink) {
rightLink = `getting-started-${rightLabel.replace(/\s+/g, "-").toLowerCase()}--docs`;
}

if (leftLink && rightLink) {
mainAlign = "space-between";
} else if (leftLink) {
Expand Down
Loading