From 83bba81a042207a5b089758fe31e60f59f66e5f7 Mon Sep 17 00:00:00 2001 From: Billy Tat Date: Wed, 7 Feb 2024 16:14:18 -0800 Subject: [PATCH] Import Tabs and TabItem globally --- .../ingress-controllers/ingress-controllers.md | 3 +-- .../example-scenarios/example-scenarios.md | 3 +-- .../one-time-snapshots/one-time-snapshots.md | 3 +-- .../recurring-snapshots/recurring-snapshots.md | 3 +-- .../restoring-from-backup/restoring-from-backup.md | 3 +-- docs/os/os.md | 3 +-- .../upgrades/how-upgrades-work/how-upgrades-work.md | 3 +-- docs/upgrades/upgrades.md | 3 +-- src/theme/MDXComponents.js | 13 +++++++++++++ 9 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 src/theme/MDXComponents.js diff --git a/docs/config-options/add-ons/ingress-controllers/ingress-controllers.md b/docs/config-options/add-ons/ingress-controllers/ingress-controllers.md index 1b715ad..9c6a6e5 100644 --- a/docs/config-options/add-ons/ingress-controllers/ingress-controllers.md +++ b/docs/config-options/add-ons/ingress-controllers/ingress-controllers.md @@ -3,8 +3,7 @@ title: K8s Ingress Controllers description: By default, RKE deploys the NGINX ingress controller. Learn how to schedule and disable default k8s ingress controllers, and how to configure NGINX controller --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + ### Default Ingress diff --git a/docs/etcd-snapshots/example-scenarios/example-scenarios.md b/docs/etcd-snapshots/example-scenarios/example-scenarios.md index 40f084a..b5f1aa8 100644 --- a/docs/etcd-snapshots/example-scenarios/example-scenarios.md +++ b/docs/etcd-snapshots/example-scenarios/example-scenarios.md @@ -2,8 +2,7 @@ title: Example Scenarios --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + These example scenarios for backup and restore are different based on your version of RKE. diff --git a/docs/etcd-snapshots/one-time-snapshots/one-time-snapshots.md b/docs/etcd-snapshots/one-time-snapshots/one-time-snapshots.md index 2ed319c..85ed939 100644 --- a/docs/etcd-snapshots/one-time-snapshots/one-time-snapshots.md +++ b/docs/etcd-snapshots/one-time-snapshots/one-time-snapshots.md @@ -2,8 +2,7 @@ title: One-time Snapshots --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + One-time snapshots are handled differently depending on your version of RKE. diff --git a/docs/etcd-snapshots/recurring-snapshots/recurring-snapshots.md b/docs/etcd-snapshots/recurring-snapshots/recurring-snapshots.md index 0d4eebf..a5395cb 100644 --- a/docs/etcd-snapshots/recurring-snapshots/recurring-snapshots.md +++ b/docs/etcd-snapshots/recurring-snapshots/recurring-snapshots.md @@ -2,8 +2,7 @@ title: Recurring Snapshots --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + Recurring snapshots are handled differently based on your version of RKE. diff --git a/docs/etcd-snapshots/restoring-from-backup/restoring-from-backup.md b/docs/etcd-snapshots/restoring-from-backup/restoring-from-backup.md index ba087c0..71c82ff 100644 --- a/docs/etcd-snapshots/restoring-from-backup/restoring-from-backup.md +++ b/docs/etcd-snapshots/restoring-from-backup/restoring-from-backup.md @@ -2,8 +2,7 @@ title: Restoring from Backup --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + The details of restoring your cluster from backup are different depending on your version of RKE. diff --git a/docs/os/os.md b/docs/os/os.md index 8d8b6b6..f2f2749 100644 --- a/docs/os/os.md +++ b/docs/os/os.md @@ -2,8 +2,7 @@ title: Requirements --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + ## Operating System diff --git a/docs/upgrades/how-upgrades-work/how-upgrades-work.md b/docs/upgrades/how-upgrades-work/how-upgrades-work.md index 73c86d6..e0bfb50 100644 --- a/docs/upgrades/how-upgrades-work/how-upgrades-work.md +++ b/docs/upgrades/how-upgrades-work/how-upgrades-work.md @@ -2,8 +2,7 @@ title: How Upgrades Work --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + In this section, you'll learn what happens when you edit or upgrade your RKE Kubernetes cluster. The below sections describe how each type of node is upgraded by default when a cluster is upgraded using `rke up`. diff --git a/docs/upgrades/upgrades.md b/docs/upgrades/upgrades.md index f3532a4..937eaa3 100644 --- a/docs/upgrades/upgrades.md +++ b/docs/upgrades/upgrades.md @@ -2,8 +2,7 @@ title: Upgrades --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; + After RKE has deployed Kubernetes, you can upgrade the versions of the components in your Kubernetes cluster, the [definition of the Kubernetes services](../config-options/services/services.md) or the [add-ons](../config-options/add-ons/add-ons.md). diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js new file mode 100644 index 0000000..a6c38e8 --- /dev/null +++ b/src/theme/MDXComponents.js @@ -0,0 +1,13 @@ +import React from 'react'; +// Import the original mapper +import MDXComponents from '@theme-original/MDXComponents'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +export default { + // Re-use the default mapping + ...MDXComponents, + // Global import the and components + Tabs: Tabs, + TabItem: TabItem, +}; \ No newline at end of file