Skip to content

Commit c74ee31

Browse files
committed
Update ion-docs to React to v19
Update ion-docs to React to v19
1 parent 6f5a148 commit c74ee31

File tree

13 files changed

+5649
-2488
lines changed

13 files changed

+5649
-2488
lines changed

docs/core-concepts/webview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import { Capacitor } from '@capacitor/core';
4242
Capacitor.convertFileSrc(filePath);
4343
```
4444

45-
For Cordova apps, the [Ionic Web View plugin](https://github.com/ionic-team/cordova-plugin-ionic-webview) provides a utility function for converting File URIs: `window.Ionic.WebView.convertFileSrc()`. There is also a corresponding Ionic Native plugin: [`@awesome-cordova-plugins/ionic-webview`](../native/ionic-webview.md).
45+
For Cordova apps, the [Ionic Web View plugin](https://github.com/ionic-team/cordova-plugin-ionic-webview) provides a utility function for converting File URIs: `window.Ionic.WebView.convertFileSrc()`. There is also a corresponding Ionic Native plugin: `@awesome-cordova-plugins/ionic-webview`.
4646

4747
### Implementations
4848

docusaurus.config.js

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
11
const path = require('path');
22
const prismic = require('@prismicio/client');
3-
const fetch = require('node-fetch');
43

54
const VERSIONS_JSON = require('./versions.json');
6-
7-
/**
8-
* Old versions of the Ionic Docs are archived so
9-
* that we do not need to re-build it every time we deploy.
10-
* Building a large number of docs sites at once can cause
11-
* out of memory issues, so archiving old docs sites
12-
* allow us to keep memory usage and build times low.
13-
*
14-
* Note that this file is only for versions of the Ionic Docs
15-
* that are built with Docusaurus. The
16-
* Ionic v3 and v4 docs are built with other tools, so those
17-
* versions are not included here.
18-
*
19-
* Note that the urls specified in this file should
20-
* NOT have a trailing slash otherwise users will
21-
* briefly get a 404 Page Not Found error before
22-
* the docuementation website loads.
23-
*/
245
const ARCHIVED_VERSIONS_JSON = require('./versionsArchived.json');
256

26-
/**
27-
* This returns an array where each entry is an array
28-
* containing the version name at index 0 and
29-
* the archive url at index 1.
30-
*/
317
const ArchivedVersionsDropdownItems = Object.entries(ARCHIVED_VERSIONS_JSON).splice(0, 5);
32-
338
const BASE_URL = '/docs';
349

3510
module.exports = {
@@ -51,12 +26,12 @@ module.exports = {
5126
favicon: 'img/meta/favicon-96x96.png',
5227
organizationName: 'ionic-team',
5328
projectName: 'ionic-docs',
29+
5430
presets: [
5531
[
5632
'@docusaurus/preset-classic',
5733
/** @type {import('@docusaurus/preset-classic').Options} */
5834
{
59-
// Will be passed to @docusaurus/plugin-content-docs (false to disable).
6035
docs: {
6136
routeBasePath: '/',
6237
sidebarPath: require.resolve('./sidebars.js'),
@@ -81,18 +56,15 @@ module.exports = {
8156
},
8257
exclude: ['README.md'],
8358
lastVersion: 'current',
84-
/** @type {import('@docusaurus/plugin-content-docs').VersionOptions} */
8559
versions: {
8660
current: {
8761
label: 'v8',
8862
},
8963
},
9064
},
91-
// Will be passed to @docusaurus/plugin-google-tag-manager.
9265
googleTagManager: {
9366
containerId: 'GTM-TKMGCBC',
9467
},
95-
// Will be passed to @docusaurus/theme-classic.
9668
theme: {
9769
customCss: [
9870
require.resolve('./node_modules/modern-normalize/modern-normalize.css'),
@@ -103,6 +75,7 @@ module.exports = {
10375
},
10476
],
10577
],
78+
10679
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
10780
themeConfig: {
10881
announcementBar: {
@@ -114,34 +87,13 @@ module.exports = {
11487
metadata: [
11588
{ name: 'og:image', content: 'https://ionicframework.com/docs/img/meta/open-graph.png' },
11689
{ name: 'twitter:image', content: 'https://ionicframework.com/docs/img/meta/open-graph.png' },
117-
{
118-
name: 'twitter:card',
119-
content: 'summary_large_image',
120-
},
121-
{
122-
name: 'twitter:domain',
123-
content: 'ionicframework.com',
124-
},
125-
{
126-
name: 'twitter:site',
127-
content: '@ionicframework',
128-
},
129-
{
130-
name: 'twitter:creator',
131-
content: 'ionicframework',
132-
},
133-
{
134-
name: 'fb:page_id',
135-
content: '1321836767955949',
136-
},
137-
{
138-
name: 'og:type',
139-
content: 'website',
140-
},
141-
{
142-
name: 'og:site_name',
143-
content: 'Ionic Framework Docs',
144-
},
90+
{ name: 'twitter:card', content: 'summary_large_image' },
91+
{ name: 'twitter:domain', content: 'ionicframework.com' },
92+
{ name: 'twitter:site', content: '@ionicframework' },
93+
{ name: 'twitter:creator', content: 'ionicframework' },
94+
{ name: 'fb:page_id', content: '1321836767955949' },
95+
{ name: 'og:type', content: 'website' },
96+
{ name: 'og:site_name', content: 'Ionic Framework Docs' },
14597
],
14698
colorMode: {
14799
defaultMode: 'light',
@@ -195,22 +147,12 @@ module.exports = {
195147
dropdownItemsAfter: [
196148
...ArchivedVersionsDropdownItems.map(([versionName, versionUrl]) => ({
197149
label: versionName,
198-
/**
199-
* Use "to" instead of "href" so the
200-
* external URL icon does not show up.
201-
*/
202150
to: versionUrl,
203-
/**
204-
* Just like the version docs in this project,
205-
* we want to archived versions to open in the
206-
* same tab.
207-
*/
208151
target: '_self',
209152
})),
210153
{ to: 'https://ionicframework.com/docs/v4/components', label: 'v4', target: '_blank' },
211154
{ to: 'https://ionicframework.com/docs/v3/', label: 'v3', target: '_blank' },
212155
],
213-
// dropdownItemsAfter: [{to: '/versions', label: 'All versions'}],
214156
dropdownActiveClassDisabled: true,
215157
},
216158
{
@@ -323,8 +265,6 @@ module.exports = {
323265
},
324266
prism: {
325267
theme: { plain: {}, styles: [] },
326-
// Prism provides a [default list of languages](https://github.com/FormidableLabs/prism-react-renderer/blob/e1c83a468b05df7f452b3ad7e4ae5ab874574d4e/packages/generate-prism-languages/index.ts#L9-L26).
327-
// A list of [additional languages](https://prismjs.com/#supported-languages) that are supported can be found at their website.
328268
additionalLanguages: ['shell-session', 'http', 'diff'],
329269
},
330270
algolia: {
@@ -335,7 +275,6 @@ module.exports = {
335275
},
336276
},
337277
plugins: [
338-
// Allows usage of Sass/SCSS in the CSS preprocessor.
339278
'docusaurus-plugin-sass',
340279
[
341280
'docusaurus-plugin-module-alias',
@@ -354,10 +293,7 @@ module.exports = {
354293
async loadContent() {
355294
const repoName = 'ionicframeworkcom';
356295
const endpoint = prismic.getEndpoint(repoName);
357-
const client = prismic.createClient(endpoint, {
358-
fetch,
359-
});
360-
296+
const client = prismic.createClient(endpoint);
361297
return await client.getByType('docs_ad');
362298
},
363299
async contentLoaded({ content, actions: { setGlobalData, addRoute } }) {

0 commit comments

Comments
 (0)