Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 48 additions & 1 deletion .remarkrc.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* `mdx/remark` rule in `eslint.config.mjs`.
*/

import remarkFrontmatter from 'remark-frontmatter';

// Schemes such as https: and mailto:, in-page anchors, and protocol-relative URLs.
const NOT_A_PAGE_LINK = /^([a-z][a-z\d+.-]*:|#|\/\/)/i;

Expand Down Expand Up @@ -68,6 +70,51 @@ function docLinks() {
};
}

/**
* Every page needs a `description` in its frontmatter. Docusaurus uses it for
* the meta description, link previews, and llms.txt. Without it, Docusaurus
* builds one from the opening text of the page, which can pick up an import, a
* heading id comment, or the first line of a code sample.
*
* A `<meta name="description">` in `<head>` only sets the meta tag, so it does
* not count. Docusaurus skips files and folders starting with `_`, so those
* partials are not pages and need no description.
*/
function pageDescription() {
return (tree, file) => {
const report = (reason, place) => {
const message = file.message(reason, place);
message.source = 'ionic-docs';
message.ruleId = 'page-description';
};
if (file.path?.split(/[\\/]/).some((segment) => segment.startsWith('_'))) return;

const frontmatter = tree.children[0]?.type === 'yaml' ? tree.children[0].value : '';
if (!/^description:\s*\S/m.test(frontmatter)) {
report(
'Add a `description` to the frontmatter. Without it, Docusaurus builds one from the opening text of the page.',
{ line: 1, column: 1 }
);
}

for (const node of tree.children) {
if (node.type !== 'mdxJsxFlowElement' || node.name !== 'head') continue;
for (const child of node.children) {
const isDescription = child.name === 'meta' && child.attributes?.some((a) => a.name === 'name' && a.value === 'description');
if (isDescription) {
report(
'Move this description to the frontmatter `description`. Docusaurus does not read it from `<head>`, so link previews and llms.txt use the opening text of the page instead.',
child
);
}
}
}
};
}

export default {
plugins: [docLinks],
// remark-frontmatter parses the frontmatter as YAML, as Docusaurus does.
// Without it, the lint reads it as Markdown, and a `<` in a description
// becomes an unclosed JSX tag.
plugins: [remarkFrontmatter, docLinks, pageDescription],
};
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ The content of the Ionic docs is written as [Markdown](https://commonmark.org/)

`/docs` maps to `docs/index.mdx` through `slug: /` in its frontmatter. Older versions live in `versioned_docs/` and are served under their version, such as `/docs/v8/`.

Every page needs a `description` in its frontmatter. Docusaurus uses it for the meta description, link previews, and llms.txt, and `npm run lint` flags a page without one. Files and folders whose names start with `_` are not pages, so use that prefix for a file that other pages only import, such as `developing/config/_global.mdx`.

The frontmatter `title` names the page everywhere: its heading, the sidebar, cards, and link previews. To show a longer title only in search results and the browser tab, put it in `<head>`, such as `<head><title>ion-button: Style Buttons with Custom CSS Properties</title></head>`. A description in `<head>` has no such use, since Docusaurus only reads it from the frontmatter.

Versions listed in [`versions.json`](versions.json) are actively maintained. If your change also applies to one of them, make the same change in its `versioned_docs/version-<name>/` folder. Versions listed in [`versionsArchived.json`](versionsArchived.json) are frozen deployments that are no longer built, so changes to their folders never reach the site.

Markdown links resolve within their own version, but JSX paths such as `<Link to>` and `useBaseUrl` do not. In an older version, prefix them with the version, such as `<Link to="/v8/api/note">`.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/add-to-existing.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Add to Existing Angular Project
description: 'Learn how to add Ionic Angular to your existing Angular project. Step-by-step guide for integrating Ionic components and features into an existing Angular application.'
sidebar_label: Add to Existing
---

Expand All @@ -8,10 +9,6 @@ import DocsCards from '@components/global/DocsCards';

<head>
<title>Add Ionic Angular to Existing Project: Integration Guide</title>
<meta
name="description"
content="Learn how to add Ionic Angular to your existing Angular project. Step-by-step guide for integrating Ionic components and features into an existing Angular application."
/>
</head>

This guide covers how to add Ionic Angular to an existing Angular project. If you're looking to start a new project from scratch, check out the [Ionic Angular Quickstart](./quickstart.mdx) guide. For an overview of how Ionic Angular works with Angular, including version support and tooling, check out the [Ionic Angular Overview](./overview.mdx).
Expand Down
4 changes: 4 additions & 0 deletions docs/angular/build-options.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: 'Choose between standalone components and NgModules when using Ionic in an Angular app, with the benefits and downsides of each approach.'
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Expand Down
5 changes: 1 addition & 4 deletions docs/angular/injection-tokens.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Angular Injection Tokens
description: "Learn how to use Ionic's Angular injection tokens to access Ionic elements through Angular's dependency injection system for more streamlined component interactions."
sidebar_label: Injection Tokens
---

<head>
<title>Angular Injection Tokens | Access Ionic Elements via Dependency Injection</title>
<meta
name="description"
content="Learn how to use Ionic's Angular injection tokens to access Ionic elements through Angular's dependency injection system for more streamlined component interactions."
/>
</head>

Ionic provides Angular injection tokens that allow you to access Ionic elements through Angular's dependency injection system. This provides a more Angular-idiomatic way to interact with Ionic components programmatically.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/lifecycle.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Ionic Page Life Cycle
description: 'This guide covers how the page life cycle works in an Ionic app built with Angular. Learn how Ionic embraces life cycle events provided by Angular components.'
sidebar_label: Lifecycle
---

<head>
<title>Angular Page Component Life Cycle - App Events Documentation</title>
<meta
name="description"
content="This guide covers how the page life cycle works in an Ionic app built with Angular. Learn how Ionic embraces life cycle events provided by Angular components."
/>
</head>

This guide covers how the page life cycle works in an app built with Ionic and Angular.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/navigation.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
title: Angular Navigation
description: 'Our Angular Navigation guide covers how routing works in an app built with Ionic and Angular. Read to learn more about basic routing and redirects in Angular.'
sidebar_label: Navigation/Routing
---

import useBaseUrl from '@docusaurus/useBaseUrl';

<head>
<title>Angular Navigation: How Routing & Redirects Work in Angular Apps</title>
<meta
name="description"
content="Our Angular Navigation guide covers how routing works in an app built with Ionic and Angular. Read to learn more about basic routing and redirects in Angular."
/>
</head>

This guide covers how routing works in an app built with Ionic and Angular.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/overlays.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Overlay Components
description: 'Learn how to use overlay components like modals and popovers in Ionic Angular, including passing custom injectors for dependency injection.'
sidebar_label: Overlays
---

<head>
<title>Angular Overlay Components: Modals, Popovers with Custom Injectors</title>
<meta
name="description"
content="Learn how to use overlay components like modals and popovers in Ionic Angular, including passing custom injectors for dependency injection."
/>
</head>

Ionic provides overlay components such as modals and popovers that display content on top of your application. In Angular, these overlays can be created using controllers like `ModalController` and `PopoverController`.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/overview.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: 'Ionic Angular Overview'
description: '@ionic/angular combines the Ionic experience with the tooling and APIs tailored to Angular Developers. Learn more about version support in our Angular Overview.'
sidebar_label: Overview
---

<head>
<title>Ionic Angular Overview | Angular Version Support and Tooling</title>
<meta
name="description"
content="@ionic/angular combines the Ionic experience with the tooling and APIs tailored to Angular Developers. Learn more about version support in our Angular Overview."
/>
</head>

import DocsCard from '@components/global/DocsCard';
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/performance.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Angular Performance
description: 'Learn how Angular manages change propagation using ngFor with Ionic Components. Read for more information about Angular performance on Ionic apps.'
sidebar_label: Performance
---

<head>
<title>Angular Performance: Manage App Component Change with ngFor</title>
<meta
name="description"
content="Learn how Angular manages change propagation using ngFor with Ionic Components. Read for more information about Angular performance on Ionic apps."
/>
</head>

## \*ngFor with Ionic Components {/* #ngfor-with-ionic-components */}
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/platform.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
title: Platform
description: 'Ionic Platform service can be used to get information about your current device. With this information you can completely customize your app to fit any device.'
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<head>
<title>Platform | Ionic Platform to Customize Apps to Fit Any Device</title>
<meta
name="description"
content="Ionic Platform service can be used to get information about your current device. With this information you can completely customize your app to fit any device."
/>
</head>

The Platform service can be used to get information about your current device. You can get all of the platforms associated with the device using the `platforms` method, including whether the app is being viewed from a tablet, if it's on a mobile device or browser, and the exact platform (iOS, Android, etc). You can also get the orientation of the device, if it uses right-to-left language direction, and much much more. With this information you can completely customize your app to fit any device.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/pwa.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Progressive Web Apps in Angular
description: "When Making an Angular app a Progressive Web App, the two main requirements are a Service Worker and a Web Manifest. Read to learn more in Ionic's PWA tutorial."
sidebar_label: Progressive Web Apps
---

<head>
<title>Make Progressive Web Apps (PWA) in Angular - Ionic Tutorial</title>
<meta
name="description"
content="When Making an Angular app a Progressive Web App, the two main requirements are a Service Worker and a Web Manifest. Read to learn more in Ionic's PWA tutorial."
/>
</head>

## Making your Angular app a PWA {/* #making-your-angular-app-a-pwa */}
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Ionic Angular Quickstart
description: 'Ionic Angular Quickstart covers the basics of Angular and Ionic, including any Ionic-specific features. Learn how to build Angular apps using the Ionic CLI.'
sidebar_label: Quickstart
---

<head>
<title>Ionic Angular Quickstart Using Ionic CLI: Angular Basics</title>
<meta
name="description"
content="Ionic Angular Quickstart covers the basics of Angular and Ionic, including any Ionic-specific features. Learn how to build Angular apps using the Ionic CLI."
/>
</head>

import DocsCard from '@components/global/DocsCard';
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/slides.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
---
title: Migrating from ion-slides to Swiper.js
description: 'Read this guide to learn how to get Swiper.js for Angular set up in your Ionic Framework application for a modern touch slider component.'
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<head>
<title>Set Up Swiper.js for Angular Slides [Example] | Ionic</title>
<meta
name="description"
content="Read this guide to learn how to get Swiper.js for Angular set up in your Ionic Framework application for a modern touch slider component."
/>
</head>

:::warning[Looking for `ion-slides`?]
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/storage.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Data Storage
description: 'A variety of options are available for storing data within Ionic apps made using Angular. Choose the options that best fit your storage needs.'
sidebar_label: Storage
---

<head>
<title>Angular App Data Storage Options - Ionic Documentation</title>
<meta
name="description"
content="A variety of options are available for storing data within Ionic apps made using Angular. Choose the options that best fit your storage needs."
/>
</head>

There are a variety of options available for storing data within an Ionic application. It is best to choose options that best fit the needs of your application. A single application may have requirements that span multiple options.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/testing.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
---
title: Testing
description: 'Angular apps created using Ionic are automatically set up for unit and end-to-end testing. Read to learn more about testing tools for Ionic components.'
---

<head>
<title>Angular Unit and End-to-End Testing for Ionic App Components</title>
<meta
name="description"
content="Angular apps created using Ionic are automatically set up for unit and end-to-end testing. Read to learn more about testing tools for Ionic components."
/>
</head>

When an `@ionic/angular` application is generated using the Ionic CLI, it is automatically set up for unit testing and end-to-end testing of the application:
Expand Down
4 changes: 4 additions & 0 deletions docs/angular/virtual-scroll.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
description: 'ion-virtual-scroll was removed in Ionic 7. Learn how to render long lists in Angular with virtual scrolling from the @angular/cdk package.'
---

# Virtual Scroll

:::warning[Looking for `ion-virtual-scroll`?]
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: 'Your First Ionic App: Angular'
description: 'This Angular tutorial teaches the fundamentals of Ionic app development by creating a realistic app step-by-step. Learn to run your first Ionic app with Angular.'
sidebar_label: Build Your First App
---

<head>
<title>Build Your First Ionic Mobile App with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="This Angular tutorial teaches the fundamentals of Ionic app development by creating a realistic app step-by-step. Learn to run your first Ionic app with Angular."
/>
</head>

The great thing about Ionic is that with one codebase, you can build for any platform using just HTML, CSS, and JavaScript. Follow along as we learn the fundamentals of Ionic app development by creating a realistic app step by step.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app/2-taking-photos.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Taking Photos with the Camera
description: "Add the ability to take photos with your device's camera using the Ionic Capacitor Camera API for mobile iOS, Android, and the web. Learn how here."
sidebar_label: Taking Photos
---

<head>
<title>Take Photos with Camera API for iOS, Android & Web with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="Add the ability to take photos with your device's camera using the Ionic Capacitor Camera API for mobile iOS, Android, and the web. Learn how here."
/>
</head>

Now for the fun part - adding the ability to take photos with the device’s camera using the Capacitor [Camera API](../../native/camera.mdx). We’ll begin with building it for the web, then make some small tweaks to make it work on mobile (iOS and Android).
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app/3-saving-photos.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Saving Photos to the Filesystem
description: 'We’re now able to take multiple photos and display them in a photo gallery. Learn how to save these photos to the filesystem using the Ionic Capacitor Filesystem API.'
sidebar_label: Saving Photos
---

<head>
<title>Saving Photos to the Filesystem with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="We’re now able to take multiple photos and display them in a photo gallery. Learn how to save these photos to the filesystem using the Ionic Capacitor Filesystem API."
/>
</head>

We’re now able to take multiple photos and display them in a photo gallery on the second tab of our app. These photos, however, are not currently being stored permanently, so when the app is closed, they will be deleted.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app/4-loading-photos.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Loading Photos from the Filesystem
description: 'We’ve implemented photo taking and saving to the filesystem, now learn how Ionic leverages Capacitor Preferences API for loading our photos in a key-value store.'
sidebar_label: Loading Photos
---

<head>
<title>Loading Photos from the Filesystem with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="We’ve implemented photo taking and saving to the filesystem, now learn how Ionic leverages Capacitor Preferences API for loading our photos in a key-value store."
/>
</head>

We’ve implemented photo taking and saving to the filesystem. There’s one last piece of functionality missing: the photos are stored in the filesystem, but we need a way to save pointers to each file so that they can be displayed again in the photo gallery.
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app/5-adding-mobile.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Adding Mobile
description: 'Learn how to add mobile support to your Ionic Capacitor photo gallery app, enabling it to run on iOS, Android, and the web using one codebase.'
strip_number_prefixes: false
---

<head>
<title>Adding Mobile Support with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="Learn how to add mobile support to your Ionic Capacitor photo gallery app, enabling it to run on iOS, Android, and the web using one codebase."
/>
</head>

Our photo gallery app won’t be complete until it runs on iOS, Android, and the web - all using one codebase. All it takes is some small logic changes to support mobile platforms, installing some native tooling, then running the app on a device. Let’s go!
Expand Down
5 changes: 1 addition & 4 deletions docs/angular/your-first-app/6-deploying-mobile.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: Deploying to iOS and Android
description: 'Deploying to iOS and Android is easy with Capacitor setup for Ionic Framework apps. Read to learn more about deployment in our Ionic Documentation.'
sidebar_label: Deploying Mobile
---

<head>
<title>Adding Mobile Support with Angular | Ionic Capacitor Camera</title>
<meta
name="description"
content="Deploying to iOS and Android is easy with Capacitor setup for Ionic Framework apps. Read to learn more about deployment in our Ionic Documentation."
/>
</head>

Since we added Capacitor to our project when it was first created, there’s only a handful of steps remaining until the Photo Gallery app is on our device!
Expand Down
Loading
Loading