Skip to content

Commit

Permalink
fix: relative links (#282)
Browse files Browse the repository at this point in the history
* chore(deps): bump docusaurus deps
* chore(config): throw on broken markdown links and anchors
* fix(links): change all relative links to file references
* fix(links): signup anchor tags
  • Loading branch information
jaredcbaum committed Jun 17, 2024
1 parent e05991d commit 11c57a6
Show file tree
Hide file tree
Showing 41 changed files with 1,159 additions and 1,170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_label: Live Updates E-commerce App

## Overview

The Ionic Team has enhanced the E-commerce demo application to demonstrate how to use Live Updates in an app using Portals. The Android application uses Fragments while the iOS application uses Storyboard/ViewController based views. For more information about the demo app, see our [Portals E-commerce demo page](./ecommerce-app).
The Ionic Team has enhanced the E-commerce demo application to demonstrate how to use Live Updates in an app using Portals. The Android application uses Fragments while the iOS application uses Storyboard/ViewController based views. For more information about the demo app, see our [Portals E-commerce demo page](./ecommerce-app.md).

Below is a list of which portions of the app are native and which portions of the app are portals.

Expand Down
6 changes: 3 additions & 3 deletions website/docs/for-android/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_label: Using Portals in Android
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Once you [obtain an API key](./guide#signup) and [install Ionic Portals](./guide#install), you can start creating Portals for your application.
Once you [obtain an API key](./guide.md#signup) and [install Ionic Portals](./guide.md#install), you can start creating Portals for your application.

## Creating a Custom Application Class

Expand Down Expand Up @@ -74,7 +74,7 @@ After creating a custom Application class, be sure to add the `android:name` att

## Creating a Portal via PortalManager

The [PortalManager](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) provides convenience functions to handle the storing and retrieving of information about Portals used in your app. When using it, we recommend creating your portals in the custom `Application` class in the same place where Portals is registered so that all the required information for Portals to function is available immediately to the SDK every time the app is launched. If you prefer to have more granular control over the creation and storing of Portals data, and where it occurs in your app, we recommend creating Portals using the [PortalBuilder](./getting-started#creating-a-portal-via-portalbuilder).
The [PortalManager](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) provides convenience functions to handle the storing and retrieving of information about Portals used in your app. When using it, we recommend creating your portals in the custom `Application` class in the same place where Portals is registered so that all the required information for Portals to function is available immediately to the SDK every time the app is launched. If you prefer to have more granular control over the creation and storing of Portals data, and where it occurs in your app, we recommend creating Portals using the [PortalBuilder](./getting-started.md#creating-a-portal-via-portalbuilder).

After registering via the [PortalManager.register()](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html#-1847662668%2FFunctions%2F-149544105) function, you can create Portals. Use the [PortalManager](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) to quickly create a [Portal](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) and link it to an XML layout.

Expand Down Expand Up @@ -380,4 +380,4 @@ android {

Now that your Portal is successfully registered, created, and linked, you need to add the web assets to your application. The web code lives in folders under `src/main/assets`. You can use either many web applications or one "Single Page Application" (SPA) and dynamically link to the route you want to use. By default, the [PortalManager](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) will look in the folder named the same as the `portalId` used. You can use the [setStartDir()](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-builder/index.html#-1989968072%2FFunctions%2F-149544105) function to set the web application's directory.

For more information on how to setup your web bundle, see our how-to guide on [how to pull in a web bundle](./how-to/pull-in-web-bundle).
For more information on how to setup your web bundle, see our how-to guide on [how to pull in a web bundle](./how-to/pull-in-web-bundle.md).
2 changes: 1 addition & 1 deletion website/docs/for-android/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To add Portals to your web project, install it via NPM:
{`npm install @ionic/portals@${getPortalsVersion()}`}
</CodeBlock>

If you need help configuring specific versions of Portals with Capacitor or Capacitor Plugins, check out our [SDK Version Compatibility](./version-matrix) page.
If you need help configuring specific versions of Portals with Capacitor or Capacitor Plugins, check out our [SDK Version Compatibility](./version-matrix.md) page.

## Configure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
import { getCapacitorVersion, getPortalsVersion, getPortalsVersionIos, getPortalsVersionAndroid } from '@site/src/util';

One of the biggest benefits of including Ionic Portals in an application is the ability to easily communicate between web and native code using the [PortalsPlugin](../../for-web/portals-plugin). However, to make the integration between a Portal and your native application more seamless, creating your own Plugins may be necessary. By creating a [Capacitor Plugin](https://capacitorjs.com/docs/plugins/creating-plugins), you can create your own API to communicate between web and native code.
One of the biggest benefits of including Ionic Portals in an application is the ability to easily communicate between web and native code using the [PortalsPlugin](../../for-web/portals-plugin.md). However, to make the integration between a Portal and your native application more seamless, creating your own Plugins may be necessary. By creating a [Capacitor Plugin](https://capacitorjs.com/docs/plugins/creating-plugins), you can create your own API to communicate between web and native code.

In this example, we will create a plugin that performs a fade-in animation when a Portal has finished loading.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Now, the _"Maps & Geolocation"_ Portal will read from the `maps` directory in yo

## Project Structure

In your project, you'll need to setup multiple folders in your Assets directory if your web applications are discrete apps. For more information on how to setup web bundles in your native project, see [our how-to guide](./pull-in-web-bundle).
In your project, you'll need to setup multiple folders in your Assets directory if your web applications are discrete apps. For more information on how to setup web bundles in your native project, see [our how-to guide](./pull-in-web-bundle.md).
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_label: Multi Portal & Single Page Apps
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

In some cases, it break down a large Single Page Application (SPA) into multiple Portals to create a better User Experience. The below example is similar to the [Multi Portals with Multiple Web Applications](./multiple-portals-multiple-web-apps) example, but it is a SPA rather than multiple applications.
In some cases, it break down a large Single Page Application (SPA) into multiple Portals to create a better User Experience. The below example is similar to the [Multi Portals with Multiple Web Applications](./multiple-portals-multiple-web-apps.md) example, but it is a SPA rather than multiple applications.

## Declaring Multiple Portals

Expand Down Expand Up @@ -70,8 +70,8 @@ Similarly, the "Shopping & Checkout" Portal will be a separate instance of the S

## Injecting the Initial Context Into the Web Application

With this _initialContext_ value set, you can use this to properly navigate to the correct route within your Portal. The [Portals E-commerce example](../examples/ecommerce-app) uses this method. You can see how we [inject the context here on Github](https://github.com/ionic-team/portals-ecommerce-demo/blob/main/web/src/index.tsx) using the [Portal.getInitialContext() function](../../for-web/portals-plugin#getinitialcontext).
With this _initialContext_ value set, you can use this to properly navigate to the correct route within your Portal. The [Portals E-commerce example](../examples/ecommerce-app.md) uses this method. You can see how we [inject the context here on Github](https://github.com/ionic-team/portals-ecommerce-demo/blob/main/web/src/index.tsx) using the [Portal.getInitialContext() function](../../for-web/portals-plugin.md#getinitialcontext).

## Project Structure

In your project, you'll need to a single folder in your Assets directory that contains the built output for your SPA. For more information on how to setup web bundles in your native project, see [our how-to guide](./pull-in-web-bundle).
In your project, you'll need to a single folder in your Assets directory that contains the built output for your SPA. For more information on how to setup web bundles in your native project, see [our how-to guide](./pull-in-web-bundle.md).
2 changes: 1 addition & 1 deletion website/docs/for-android/how-to/pull-in-web-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ PortalManager.newPortal("MY_PORTAL_ID")

Once you have your web code and native code linked up, you will need a process to continually copy in new versions of the web application into your mobile projects.

We recommend having some type of automation set up so the mobile developer doesn't have to manually copy over the web code every time there is a new change. We have a few guides for ideas to do so in a [monorepo](../tutorials/monorepo-example) or [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
We recommend having some type of automation set up so the mobile developer doesn't have to manually copy over the web code every time there is a new change. We have a few guides for ideas to do so in a [monorepo](../tutorials/monorepo-example.md) or [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules).
4 changes: 2 additions & 2 deletions website/docs/for-android/how-to/sharing-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ PortalManager.newPortal("myportal")
</TabItem>
</Tabs>

When this Portal loads, the shared asset information will be passed to the web content as part of the Portal's [InitialContext](../../for-web/portals-plugin#initialcontext) object.
When this Portal loads, the shared asset information will be passed to the web content as part of the Portal's [InitialContext](../../for-web/portals-plugin.md#initialcontext) object.

## Using Registered Assets

Refer to the page in the [Web docs](../../for-web/sharing-assets) to learn how to use your registered shared assets in your web content.
Refer to the page in the [Web docs](../../for-web/sharing-assets.md) to learn how to use your registered shared assets in your web content.
10 changes: 5 additions & 5 deletions website/docs/for-android/how-to/using-the-portals-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `PortalsPlugin` provides useful features to aid in communication between you

### Android

Follow the [Getting Started Guide](../guide) to install the Ionic Portals library into your native mobile projects. The `PortalsPlugin` is automatically added to every instance of a Portal.
Follow the [Getting Started Guide](../guide.md) to install the Ionic Portals library into your native mobile projects. The `PortalsPlugin` is automatically added to every instance of a Portal.

### Web

Expand Down Expand Up @@ -90,7 +90,7 @@ mapsPortal.setInitialContext(Map.of("ic_example", "hello world"));

### Using Initial Context

To access the initial context set from the native application in your web application, import `getInitialContext` from `@ionic/portals` use the [getInitialContext()](../../for-web/portals-plugin#getinitialcontext) function.
To access the initial context set from the native application in your web application, import `getInitialContext` from `@ionic/portals` use the [getInitialContext()](../../for-web/portals-plugin.md#getinitialcontext) function.

```typescript
import { getInitialContext } from "@ionic/portals";
Expand All @@ -100,7 +100,7 @@ const initialContext = getInitialContext<{ ic_example: string }>();
console.log(initialContext?.value?.ic_example);
```

Initial context is useful when using a Single Page Application (SPA) across multiple Portals in your application. The route to a specific section of the SPA can be passed in as initial context data. Your web application can then use it to load that section directly without need for a redirect. [Check out our how-to guide](./multiple-portals-single-web-app).
Initial context is useful when using a Single Page Application (SPA) across multiple Portals in your application. The route to a specific section of the SPA can be passed in as initial context data. Your web application can then use it to load that section directly without need for a redirect. [Check out our how-to guide](./multiple-portals-single-web-app.md).

## Communicating via Pub/Sub

Expand Down Expand Up @@ -344,7 +344,7 @@ Publish messages to send data through a Portal to registered Subscribers.

#### From Web to iOS/Android

To send a message from your web application to iOS or Android, use the [Portals.publish()](../../for-web/portals-plugin#publish) function.
To send a message from your web application to iOS or Android, use the [Portals.publish()](../../for-web/portals-plugin.md#publish) function.

```typescript
import { publish } from '@ionic/portals';
Expand Down Expand Up @@ -393,4 +393,4 @@ The Capacitor [JSObject](https://github.com/ionic-team/capacitor/blob/main/andro

## Examples

The `PortalsPlugin` is used in the [E-Commerce App](../examples/ecommerce-app) demo.
The `PortalsPlugin` is used in the [E-Commerce App](../examples/ecommerce-app.md) demo.
2 changes: 1 addition & 1 deletion website/docs/for-android/live-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getCapacitorVersion, getPortalsVersion, getPortalsVersionIos, getPortal
Getting started with Live Updates in your Portals app.

:::info
To use the Live Updates SDK with Ionic Portals, check out the [Getting Started Guide](./guide) for Ionic Portals first.
To use the Live Updates SDK with Ionic Portals, check out the [Getting Started Guide](./guide.md) for Ionic Portals first.
:::

## Appflow
Expand Down
4 changes: 2 additions & 2 deletions website/docs/for-android/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ dependencies {

After installation of Portals we can setup the Portals key. Then the application is ready to have its first Portal configured. To do this, a custom [Application](https://developer.android.com/reference/android/app/Application) class is recommended. In this Application class, you can override `Application#onCreate()` to register and create Portals.

You'll need to call [PortalManager.register(myApiKey)](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html#-1847662668%2FFunctions%2F-149544105) before creating any Portals in your app. Below is a simple example of how to bootstrap Ionic Portals before loading any Portal instances in your app. Putting this registration call in an `Application` class is a good way to guarantee it is called before any Portals are created, but you can call it anywhere in your app as long as it happens before Portals are loaded. To get an API Key, refer to the [Sign Up](#signup) section.
You'll need to call [PortalManager.register(myApiKey)](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html#-1847662668%2FFunctions%2F-149544105) before creating any Portals in your app. Below is a simple example of how to bootstrap Ionic Portals before loading any Portal instances in your app. Putting this registration call in an `Application` class is a good way to guarantee it is called before any Portals are created, but you can call it anywhere in your app as long as it happens before Portals are loaded. To get an API Key, refer to the [Sign Up](./guide.md#signup) section.

<Tabs
defaultValue="kt"
Expand Down Expand Up @@ -337,7 +337,7 @@ After creating a custom Application class, be sure to add the `android:name` att

### Create the first Portal

After registering via the [PortalManager.register()](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html#-1847662668%2FFunctions%2F-149544105) function, you can create Portals. This Quick Start guide shows how to use Portals directly in an XML layout, but there are also [other ways to do this](./getting-started#using-a-portal-in-code).
After registering via the [PortalManager.register()](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html#-1847662668%2FFunctions%2F-149544105) function, you can create Portals. This Quick Start guide shows how to use Portals directly in an XML layout, but there are also [other ways to do this](./getting-started.md#using-a-portal-in-code).

Use the [PortalManager](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal-manager/index.html) to quickly create a [Portal](https://ionic.io/docs/portals-android-api-ref/-ionic-portals/io.ionic.portals/-portal/index.html) and link it to an XML layout.

Expand Down
8 changes: 4 additions & 4 deletions website/docs/for-android/tutorials/auth-token-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const auth = getInitialContext<MyPortalContext>()?.value?.auth;

### Using a Custom Plugin

Another solution you can do is to create a custom Plugin to handle passing data to and from native and web. This is the solution we used in [the example E-commerce Application](../examples/ecommerce-app) since it scales nicely and allows more than just authentication data be passed to and from the layers.
Another solution you can do is to create a custom Plugin to handle passing data to and from native and web. This is the solution we used in [the example E-commerce Application](../examples/ecommerce-app.md) since it scales nicely and allows more than just authentication data be passed to and from the layers.

For information on how to build your own Portal APIs, [see our how-to guide](../how-to/define-api-in-typescript).
For information on how to build your own Portal APIs, [see our how-to guide](../how-to/define-api-in-typescript.md).

## How to Pass Data From Web to Native

Expand Down Expand Up @@ -126,10 +126,10 @@ PortalsPubSub.getShared().subscribe("login", (@NotNull Object result) -> {
</TabItem>
</Tabs>

For more information on how to communicate with a Portal web application, [see our how to guide](../how-to/using-the-portals-plugin).
For more information on how to communicate with a Portal web application, [see our how to guide](../how-to/using-the-portals-plugin.md).

### Using a Custom Plugin

Similar to the previous section, by creating a custom plugin, you have complete control over how to communicate between web and native layers. It is possible to create a function such as `MyPlugin.syncAuthAcrossWebAndNative()` to handle managing auth tokens across web and native.

For information on how to build your own Portal APIs, [see our how-to guide](../how-to/define-api-in-typescript).
For information on how to build your own Portal APIs, [see our how-to guide](../how-to/define-api-in-typescript.md).
4 changes: 2 additions & 2 deletions website/docs/for-android/upgrade-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';

If you need help configuring specific versions of Portals with Capacitor or Capacitor Plugins, check out our [SDK Version Compatibility](./version-matrix) page.
If you need help configuring specific versions of Portals with Capacitor or Capacitor Plugins, check out our [SDK Version Compatibility](./version-matrix.md) page.

## Portals for Android 0.9.0 → 0.10.0

Expand All @@ -21,7 +21,7 @@ First review the [Capacitor 6 Update Guide](https://capacitorjs.com/docs/updatin

## Portals for Android 0.8.4 → 0.9.0

Portals for Android version `0.9.0` introduces support for the new [Portals CLI](../cli/overview). There are no dependency compatibility changes with this version.
Portals for Android version `0.9.0` introduces support for the new [Portals CLI](../cli/overview.md). There are no dependency compatibility changes with this version.

## Portals for Android 0.8.3 → 0.8.4

Expand Down
Loading

0 comments on commit 11c57a6

Please sign in to comment.