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

fix: broken links #26

Merged
merged 1 commit into from
Jul 17, 2024
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
6 changes: 3 additions & 3 deletions developer/app-router/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ClientExample from "/snippets/reference/client.mdx"
import NextConfigExample from "/snippets/reference/next-config.mdx"

The fastest way to get started with Makeswift on a new Next.js project is to follow the
[quickstart](/quickstart) guide. If you have an existing Next.js application
[quickstart](/developer/quickstart) guide. If you have an existing Next.js application
or want to set things up yourself, continue with the rest of this guide.

## System requirements
Expand Down Expand Up @@ -59,7 +59,7 @@ MAKESWIFT_SITE_API_KEY=paste-your-api-key-here
</Step>
<Step title="Add Makeswift runtime and client">

Create files for the Makeswift [runtime](/reference/runtime/constructor) and [client](/reference/client/constructor).
Create files for the Makeswift [runtime](/developer/reference/runtime/constructor) and [client](/developer/reference/client/constructor).

<CodeGroup>
<RuntimeExample />
Expand Down Expand Up @@ -93,7 +93,7 @@ Next.js plugins are configured in the project's next.config.js file by wrapping
</Step>
<Step title="Register components with Makeswift">

Create a file for registered components called `makeswift/components.tsx`. In this example, only one component is registered. However, as you register more components, we recommend creating separate files for each component and rolling up the imports in the `makeswift/components.ts` file. Learn more about [registering components](/reference/runtime/register-component).
Create a file for registered components called `makeswift/components.tsx`. In this example, only one component is registered. However, as you register more components, we recommend creating separate files for each component and rolling up the imports in the `makeswift/components.ts` file. Learn more about [registering components](/developer/reference/runtime/register-component).

```tsx makeswift/components.tsx
import { ReactRuntime } from "@makeswift/runtime/react"
Expand Down
12 changes: 6 additions & 6 deletions developer/app-router/localization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ import LocalizationExample from "/snippets/app-router/localization.mdx"
<Step title="Add locales in the Makeswift builder">
Open site settings and go to the "Locales" tab:

![Localization first step](../images/localization-first-step.png)
![Localization first step](/images/localization-first-step.png)

To add a new locale, click the "+ Add locale" button. You can modify or delete existing locales by hovering over the locale:

![Hovering over the locale](../images/localization-hover-locale.png)
![Hovering over the locale](/images/localization-hover-locale.png)

You can also modify the default locale by hovering over the default locale and clicking the edit button.

Once you add all the locales you need, it might look like this:

![Manage locales in settings](../images/localization-manage-locales.png)
![Manage locales in settings](/images/localization-manage-locales.png)

</Step>

<Step title="Configure your Next.js app for localization">

Follow the [internationalization docs](https://nextjs.org/docs/app/building-your-application/routing/internationalization) for app router and make sure that all routes except the [Makeswift API handler](/reference/makeswift-api-handler) are nested inside `/app/[lang]`.
Follow the [internationalization docs](https://nextjs.org/docs/app/building-your-application/routing/internationalization) for app router and make sure that all routes except the [Makeswift API handler](/developer/reference/makeswift-api-handler) are nested inside `/app/[lang]`.

</Step>

Expand All @@ -56,7 +56,7 @@ Update your catch-all route to fetch the snapshot by locale.

Once you've set everything up, you should be able to switch to the locale using the locale switcher on the builder.

![Manage locales in settings](../images/localization-locales-switcher.png)
![Manage locales in settings](/images/localization-locales-switcher.png)

<Note>

Expand All @@ -75,7 +75,7 @@ but nested on the locale's path. For example, `es` pages will be located on `exa

To use domain-based localization, just add the domain to the locale on your site settings:

![Adding domain-based on settings](../images/localization-domain-based-settings.png)
![Adding domain-based on settings](/images/localization-domain-based-settings.png)

Once you've done that, the Spanish localized pages will be located on `example.es/page`.

Expand Down
40 changes: 20 additions & 20 deletions developer/concepts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,61 +19,61 @@ You can read more about props in the [React documentation](https://react.dev/lea

## Controls

Controls describe the way users can pass data to your components props. Each control maps a [prop](#props) on your component to user interface elements such as <Tooltip tip="Form elements in the right sidebar of the Makeswift builder">panels</Tooltip> and <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlays</Tooltip>. Controls are defined when [registering components](/reference/runtime/register-component).
Controls describe the way users can pass data to your components props. Each control maps a [prop](#props) on your component to user interface elements such as <Tooltip tip="Form elements in the right sidebar of the Makeswift builder">panels</Tooltip> and <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlays</Tooltip>. Controls are defined when [registering components](/developer/reference/runtime/register-component).

There are two types of controls: [basic](#basic-controls) and [composable](#composable-controls) controls.

### Basic controls

Basic controls cannot contain other controls. Multiple basic controls can provide the same type of data, but with different user interfaces. For example, you can provide a `string` to your component with a [`TextInput`](/reference/controls/text-input), [`TextArea`](/reference/controls/text-area), [`Select`](/reference/controls/select), or [`Combobox`](/reference/controls/combobox) control. Here are all of the basic controls:
Basic controls cannot contain other controls. Multiple basic controls can provide the same type of data, but with different user interfaces. For example, you can provide a `string` to your component with a [`TextInput`](/developer/reference/controls/text-input), [`TextArea`](/developer/reference/controls/text-area), [`Select`](/developer/reference/controls/select), or [`Combobox`](/developer/reference/controls/combobox) control. Here are all of the basic controls:

<CardGroup cols={3}>
<Card
title="Checkbox"
icon="square-check"
href="/reference/controls/checkbox"
href="/developer/reference/controls/checkbox"
/>
<Card title="Color" icon="palette" href="/reference/controls/color" />
<Card title="Color" icon="palette" href="/developer/reference/controls/color" />
<Card
title="Combobox"
icon="input-pipe"
href="/reference/controls/combobox"
href="/developer/reference/controls/combobox"
/>
<Card title="Image" icon="image" href="/reference/controls/image" />
<Card title="Link" icon="link" href="/reference/controls/link" />
<Card title="Number" icon="input-numeric" href="/reference/controls/number" />
<Card title="Select" icon="list-dropdown" href="/reference/controls/select" />
<Card title="Image" icon="image" href="/developer/reference/controls/image" />
<Card title="Link" icon="link" href="/developer/reference/controls/link" />
<Card title="Number" icon="input-numeric" href="/developer/reference/controls/number" />
<Card title="Select" icon="list-dropdown" href="/developer/reference/controls/select" />
<Card
title="TextArea"
icon="align-left"
href="/reference/controls/text-area"
href="/developer/reference/controls/text-area"
/>
<Card
title="TextInput"
icon="input-text"
href="/reference/controls/text-input"
href="/developer/reference/controls/text-input"
/>
</CardGroup>

There are three special basic controls that are designed for specific types of props such as `className` and `children`:

<CardGroup cols={3}>
<Card title="RichText" icon="text" href="/reference/controls/rich-text" />
<Card title="Slot" icon="square-dashed" href="/reference/controls/slot" />
<Card title="Style" icon="droplet" href="/reference/controls/style" />
<Card title="RichText" icon="text" href="/developer/reference/controls/rich-text" />
<Card title="Slot" icon="square-dashed" href="/developer/reference/controls/slot" />
<Card title="Style" icon="droplet" href="/developer/reference/controls/style" />
</CardGroup>

- The [`RichText`](/reference/controls/rich-text) control provides a `ReactNode` to your component and then renders an inline rich text editor <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlay</Tooltip> wherever the builder renders the `ReactNode`.
- The [`RichText`](/developer/reference/controls/rich-text) control provides a `ReactNode` to your component and then renders an inline rich text editor <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlay</Tooltip> wherever the builder renders the `ReactNode`.

- The [`Slot`](/reference/controls/slot) control provides a `ReactNode` to your component and places a drop zone <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlay</Tooltip> wherever the builder renders the prop. Users can then add components visually to that drop zone.
- The [`Slot`](/developer/reference/controls/slot) control provides a `ReactNode` to your component and places a drop zone <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlay</Tooltip> wherever the builder renders the prop. Users can then add components visually to that drop zone.

- The [`Style`](/reference/controls/style) control provides multiple <Tooltip tip="Form elements in the right sidebar of the Makeswift builder">panels</Tooltip> and <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlays</Tooltip> that modify various CSS properties. This data is then passed to your component as a `string` value.
- The [`Style`](/developer/reference/controls/style) control provides multiple <Tooltip tip="Form elements in the right sidebar of the Makeswift builder">panels</Tooltip> and <Tooltip tip="Interactive elements placed on the Makeswift builder preview">overlays</Tooltip> that modify various CSS properties. This data is then passed to your component as a `string` value.

### Composable controls

Composable controls provide an `array` or `object` to a prop of your component. Composable controls have a `type` property that can recursively contain any control. The [`List`](/reference/controls/list) control is used to modify props that expect an `array`, and the [`Shape`](/reference/controls/shape) control is used to modify props that expect an `object`.
Composable controls provide an `array` or `object` to a prop of your component. Composable controls have a `type` property that can recursively contain any control. The [`List`](/developer/reference/controls/list) control is used to modify props that expect an `array`, and the [`Shape`](/developer/reference/controls/shape) control is used to modify props that expect an `object`.

<CardGroup cols={2}>
<Card title="List" icon="list" href="/reference/controls/list" />
<Card title="Shape" icon="brackets-curly" href="/reference/controls/shape" />
<Card title="List" icon="list" href="/developer/reference/controls/list" />
<Card title="Shape" icon="brackets-curly" href="/developer/reference/controls/shape" />
</CardGroup>
2 changes: 1 addition & 1 deletion developer/guides/environments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ We recommend familiarizing yourself with Makeswift's layout controls by creating
Examples of primitive components include Buttons, Cards, Carousels, Feeds etc.
</Info>

Once you've identified and implemented your primitive components, the next step is to [register](/reference/runtime/register-component) and test them in your local development site. The focus should be on testing the interface you are creating for your marketing team. Pages used here to test your components should be considered throwaway and not used for content publishing.
Once you've identified and implemented your primitive components, the next step is to [register](/developer/reference/runtime/register-component) and test them in your local development site. The focus should be on testing the interface you are creating for your marketing team. Pages used here to test your components should be considered throwaway and not used for content publishing.

### Content publishing

Expand Down
8 changes: 4 additions & 4 deletions developer/pages-router/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ApiHandlerExample from "/snippets/pages-router/api-handler.mdx"
import PagesAppExample from "/snippets/pages-router/pages-app.mdx"

The fastest way to get started with Makeswift on a new Next.js project is to follow the
[quickstart](/quickstart) guide. If you have an existing Next.js application
[quickstart](/developer/quickstart) guide. If you have an existing Next.js application
or want to set things up yourself, continue with the rest of this guide.

## System requirements
Expand Down Expand Up @@ -55,7 +55,7 @@ MAKESWIFT_SITE_API_KEY=paste-your-api-key-here
</Step>
<Step title="Add Makeswift runtime and client">

Create files for the Makeswift [runtime](/reference/runtime/constructor) and [client](/reference/client/constructor).
Create files for the Makeswift [runtime](/developer/reference/runtime/constructor) and [client](/developer/reference/client/constructor).

<CodeGroup>
<RuntimeExample />
Expand Down Expand Up @@ -122,7 +122,7 @@ export default class MyDocument extends Document {
</Step>
<Step title="Register components with Makeswift">

Create a file for registered components called `makeswift/components.tsx`. In this example, only one component is registered. However, as you register more components, we recommend creating separate files for each component and rolling up the imports in the `makeswift/components.ts` file. Learn more about [registering components](/reference/runtime/register-component).
Create a file for registered components called `makeswift/components.tsx`. In this example, only one component is registered. However, as you register more components, we recommend creating separate files for each component and rolling up the imports in the `makeswift/components.ts` file. Learn more about [registering components](/developer/reference/runtime/register-component).

<ComponentsExample />

Expand All @@ -137,7 +137,7 @@ If you don't have a [Custom App](https://nextjs.org/docs/pages/building-your-app

<Step title="Add a route for Makeswift pages">

Create an [optional catch-all route](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#optional-catch-all-segments) named `[[...path]].tsx`. You will use this route to fetch page snapshots from the `Makeswift` client and render them using the [`Page`](/reference/components/page) component.
Create an [optional catch-all route](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#optional-catch-all-segments) named `[[...path]].tsx`. You will use this route to fetch page snapshots from the `Makeswift` client and render them using the [`Page`](/developer/reference/components/page) component.

<PagesCatchAllExample />

Expand Down
10 changes: 5 additions & 5 deletions developer/pages-router/localization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ import NextConfigDomainLocalizedExample from "/snippets/pages-router/next-config
<Step title="Add locales in the Makeswift builder">
Open site settings and go to the "Locales" tab:

![Localization first step](../images/localization-first-step.png)
![Localization first step](/images/localization-first-step.png)

To add a new locale, click the "+ Add locale" button. You can modify or delete existing locales by hovering over the locale:

![Hovering over the locale](../images/localization-hover-locale.png)
![Hovering over the locale](/images/localization-hover-locale.png)

You can also modify the default locale by hovering over the default locale and clicking the edit button.

Once you add all the locales you need, it might look like this:

![Manage locales in settings](../images/localization-manage-locales.png)
![Manage locales in settings](/images/localization-manage-locales.png)

</Step>

Expand Down Expand Up @@ -66,7 +66,7 @@ This code is usually located in `[[...path]].tsx`, but it might be different dep

Once you've set everything up, you should be able to switch to the locale using the locale switcher on the builder.

![Manage locales in settings](../images/localization-locales-switcher.png)
![Manage locales in settings](/images/localization-locales-switcher.png)

<Note>

Expand All @@ -85,7 +85,7 @@ but nested on the locale's path. For example, `es` pages will be located on `exa

To use domain-based localization, first, add the domain to the locale on your site settings:

![Adding domain-based on settings](../images/localization-domain-based-settings.png)
![Adding domain-based on settings](/images/localization-domain-based-settings.png)

Then, add the domain to your `next.config.mjs`:

Expand Down
4 changes: 2 additions & 2 deletions developer/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "Quickstart"
description:
---

We recommend using the automatic setup to explore Makeswift in a fresh Next.js app. If you have an existing Next.js app, you can use the [manual installation](/guides/manual-installation) guide.
We recommend using the automatic setup to explore Makeswift in a fresh Next.js app. If you have an existing Next.js app, you can use the [manual installation](/developer/app-router/installation) guide.

# Requirements

Expand Down Expand Up @@ -78,7 +78,7 @@ You don't need an existing Makeswift account to get started with this guide.
<img src="/images/registered-components.png" alt="Screenshot of custom components in toolbar" />
</Frame>

These components will be located in the `components` folder of your Next.js app. You can explore the files ending with `.makeswift.ts` to learn more about [registering components](/reference/runtime/register-component).
These components will be located in the `components` folder of your Next.js app. You can explore the files ending with `.makeswift.ts` to learn more about [registering components](/developer/reference/runtime/register-component).

To learn how to use Makeswift builder, see the [Help Center](https://help.makeswift.com/) articles.

Expand Down
4 changes: 2 additions & 2 deletions developer/reference/client/constructor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import ClientExample from "/snippets/reference/client.mdx"
The API key for the Makeswift site.
</ParamField>
2. <ParamField query="options" type="object">
Options for a [runtime instance](reference/runtime/constructor).
Options for a [runtime instance](/developer/reference/runtime/constructor).
<Expandable>
<ParamField query="runtime" type="ReactRuntime">
A [runtime instance](/reference/runtime/constructor). Required for
A [runtime instance](/developer/reference/runtime/constructor). Required for
custom breakpoints.
</ParamField>
</Expandable>
Expand Down
6 changes: 3 additions & 3 deletions developer/reference/client/get-page-snapshot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import PagesCatchAllLocalizedExample from "/snippets/pages-router/catch-all-loca
<Expandable>
<ParamField query="siteVersion" type="SiteVersion" required>
The return value from
[`getSiteVersion`](/reference/makeswift/get-site-version).
[`getSiteVersion`](/developer/reference/client/get-site-version).
</ParamField>
<ParamField query="locale" type="string">
A valid locale string.
Expand All @@ -28,14 +28,14 @@ import PagesCatchAllLocalizedExample from "/snippets/pages-router/catch-all-loca

<ResponseField name="snapshot" type="Snapshot">
An opaque `Snapshot` object that is only intended to be rendered by the
[`<Page>`](/reference/components/page) component.
[`<Page>`](/developer/reference/components/page) component.
</ResponseField>

## Examples

### Basic usage

The following example sets up a [catch all route](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments) where page [snapshots](/architecture/concepts#snapshots) are fetched from Makeswift and rendered using the [`<Page>`](/reference/components/page) component.
The following example sets up a [catch all route](https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments) where page snapshots are fetched from Makeswift and rendered using the [`<Page>`](/developer/reference/components/page) component.

<PagesCatchAllExample />

Expand Down
Loading