+
+
From 5ae1c87307626b1e1505b0d34846764fed364d4a Mon Sep 17 00:00:00 2001
From: Josh Wong <23216828+josh-wong@users.noreply.github.com>
Date: Thu, 12 Sep 2024 20:46:00 +0900
Subject: [PATCH 1/9] Create index.tsx
---
src/theme/NotFound/Content/index.tsx | 38 ++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 src/theme/NotFound/Content/index.tsx
diff --git a/src/theme/NotFound/Content/index.tsx b/src/theme/NotFound/Content/index.tsx
new file mode 100644
index 0000000..5ca4c19
--- /dev/null
+++ b/src/theme/NotFound/Content/index.tsx
@@ -0,0 +1,38 @@
+import React from 'react';
+import clsx from 'clsx';
+import Translate from '@docusaurus/Translate';
+import type {Props} from '@theme/NotFound/Content';
+import Heading from '@theme/Heading';
+
+export default function NotFoundContent({className}: Props): JSX.Element {
+ return (
+
+
+
+
-
-
+
You will be redirected in 10 seconds.';
+ popup.appendChild(countdown);
+
+ // Append popup to overlay
+ overlay.appendChild(popup);
+
+ // Append overlay to body
+ document.body.appendChild(overlay);
+
+ // Countdown function
+ let timeRemaining = redirectTime / 1000; // Convert milliseconds to seconds
+ const countdownElement = document.getElementById('countdown');
+
+ const updateCountdown = () => {
+ countdownElement.innerText = timeRemaining;
+ if (timeRemaining <= 0) {
+ clearInterval(countdownInterval);
+ window.location.href = redirectUrl;
+ } else {
+ timeRemaining--;
+ }
+ };
+
+ // Update countdown every second
+ const countdownInterval = setInterval(updateCountdown, 1000);
+
+ // Initial update
+ updateCountdown();
+});
From 80ac251db93114c936b0c999266d758a08eaec38 Mon Sep 17 00:00:00 2001
From: Josh Wong <23216828+josh-wong@users.noreply.github.com>
Date: Tue, 17 Sep 2024 21:01:00 +0900
Subject: [PATCH 8/9] Redirect to same page on ScalarDB docs site; remove timer
---
static/redirect.js | 47 +++++++++++++++-------------------------------
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/static/redirect.js b/static/redirect.js
index ab6900c..10b75a6 100644
--- a/static/redirect.js
+++ b/static/redirect.js
@@ -1,8 +1,9 @@
document.addEventListener('DOMContentLoaded', function() {
- const redirectUrl = 'https://scalardb.scalar-labs.com/docs/latest/';
- const redirectTime = 10000; // 10,000 milliseconds = 10 seconds
+ const baseUrl = 'https://scalardb.scalar-labs.com'; // Base URL for redirection
+ // Redirect happens immediately. Otherwise, we can use the following to specify seconds.
+ // const redirectTime = 10000; // 10,000 milliseconds = 10 seconds
- // Create and style the overlay element
+ // Create and style the overlay element.
const overlay = document.createElement('div');
overlay.style.position = 'fixed';
overlay.style.top = '0';
@@ -15,7 +16,7 @@ document.addEventListener('DOMContentLoaded', function() {
overlay.style.justifyContent = 'center';
overlay.style.alignItems = 'center';
- // Create and style the popup element
+ // Create and style the popup element.
const popup = document.createElement('div');
popup.style.backgroundColor = '#fff';
popup.style.color = '#000';
@@ -26,38 +27,20 @@ document.addEventListener('DOMContentLoaded', function() {
popup.style.zIndex = '1001';
popup.style.textAlign = 'center';
- // Create and style the countdown timer element
- const countdown = document.createElement('div');
- countdown.style.fontSize = '16px';
- countdown.style.marginTop = '10px';
+ // Add message to the popup.
+ popup.innerHTML = 'The ScalarDB Community docs site has been merged with the ScalarDB docs site.';
- // Add countdown timer to the popup
- popup.innerHTML = 'The ScalarDB Community docs site has been merged with the ScalarDB docs site.
You will be redirected in 10 seconds.';
- popup.appendChild(countdown);
-
- // Append popup to overlay
+ // Append popup to overlay.
overlay.appendChild(popup);
- // Append overlay to body
+ // Append overlay to body.
document.body.appendChild(overlay);
- // Countdown function
- let timeRemaining = redirectTime / 1000; // Convert milliseconds to seconds
- const countdownElement = document.getElementById('countdown');
-
- const updateCountdown = () => {
- countdownElement.innerText = timeRemaining;
- if (timeRemaining <= 0) {
- clearInterval(countdownInterval);
- window.location.href = redirectUrl;
- } else {
- timeRemaining--;
- }
- };
-
- // Update countdown every second
- const countdownInterval = setInterval(updateCountdown, 1000);
+ // Get current path.
+ const currentPath = window.location.pathname;
- // Initial update
- updateCountdown();
+ // Set timeout for redirect
+ setTimeout(function() {
+ window.location.href = `${baseUrl}${currentPath}`;
+ },); // Redirect happens immediately. Otherwise, we can specify `redirectTime);` at the end of this line.
});
From a1cfeb3b9a1f4c56cfe7532539a8dc754c297199 Mon Sep 17 00:00:00 2001
From: Josh Wong <23216828+josh-wong@users.noreply.github.com>
Date: Tue, 17 Sep 2024 21:02:50 +0900
Subject: [PATCH 9/9] Remove individual redirects
More user-friendly method for redirects exists in `static/redirect.js`.
---
docusaurus.config.js | 193 -------------------------------------------
1 file changed, 193 deletions(-)
diff --git a/docusaurus.config.js b/docusaurus.config.js
index b1c87e2..96292e3 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -156,199 +156,6 @@ const config = {
to: 'https://scalardb.scalar-labs.com/docs/latest/',
from: ['/', '/docs'],
},
- {
- to: 'https://scalardb.scalar-labs.com/docs/releases/release-notes',
- from: '/docs/releases/release-notes',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-analytics-postgresql/getting-started',
- from: '/docs/scalardb-analytics-postgresql/getting-started',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-analytics-postgresql/installation',
- from: '/docs/scalardb-analytics-postgresql/installation',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-analytics-postgresql/scalardb-fdw',
- from: '/docs/scalardb-analytics-postgresql/scalardb-fdw',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-analytics-postgresql/schema-importer',
- from: '/docs/scalardb-analytics-postgresql/schema-importer',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-benchmarks/README',
- from: '/docs/scalardb-benchmarks/README',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-samples/microservice-transaction-sample/README',
- from: '/docs/scalardb-samples/microservice-transaction-sample/README',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/',
- from: '/DOC',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-samples/multi-storage-transaction-sample/README',
- from: '/docs/scalardb-samples/multi-storage-transaction-sample/README',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-samples/scalardb-analytics-postgresql-sample/README',
- from: '/docs/scalardb-samples/scalardb-analytics-postgresql-sample/README',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-samples/README',
- from: '/docs/scalardb-samples/README',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/add-scalardb-to-your-build',
- from: '/docs/add-scalardb-to-your-build',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/api-guide',
- from: '/docs/api-guide',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/backup-restore',
- from: '/docs/backup-restore',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/configurations',
- from: '/docs/configurations',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/data-modeling',
- from: '/docs/data-modeling',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/database-configurations',
- from: '/docs/database-configurations',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/design',
- from: '/docs/design',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/develop-overview',
- from: '/docs/develop-overview',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/getting-started-with-scalardb-by-using-kotlin',
- from: '/docs/getting-started-with-scalardb-by-using-kotlin',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/getting-started-with-scalardb',
- from: '/docs/getting-started-with-scalardb',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/',
- from: '/docs/index',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/multi-storage-transactions',
- from: '/docs/multi-storage-transactions',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/overview',
- from: '/docs/overview',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/quick-start-overview',
- from: '/docs/quick-start-overview',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/requirements',
- from: '/docs/requirements',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/roadmap',
- from: '/docs/roadmap',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/run-non-transactional-storage-operations-through-library',
- from: '/docs/run-non-transactional-storage-operations-through-library',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/run-non-transactional-storage-operations-through-primitive-crud-interface',
- from: '/docs/run-non-transactional-storage-operations-through-primitive-crud-interface',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/run-transactions-through-scalardb-core-library',
- from: '/docs/run-transactions-through-scalardb-core-library',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-core-status-codes',
- from: '/docs/scalardb-core-status-codes',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/docs/scalardb-cluster/index',
- from: '/docs/scalardb-server',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/scalardb-supported-databases',
- from: '/docs/scalardb-supported-databases',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/schema-loader-import',
- from: '/docs/schema-loader-import',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/schema-loader',
- from: '/docs/schema-loader',
- },
- {
- to: 'https://scalardb.scalar-labs.com/docs/latest/two-phase-commit-transactions',
- from: '/docs/two-phase-commit-transactions',
- },
- {
- to: 'https://scalardb.scalar-labs.com/unsupported-versions',
- from: '/unsupported-versions',
- },
- // Redirect for 3.12 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.12/',
- from: '/docs/3.12/**',
- },
- // Redirect for 3.11 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.11/',
- from: '/docs/3.11/**',
- },
- // Redirect for 3.10 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.10/',
- from: '/docs/3.10/**',
- },
- // Redirect for 3.9 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.9/',
- from: '/docs/3.9/**',
- },
- // Redirect for 3.8 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.8/',
- from: '/docs/3.8/**',
- },
- // Redirect for 3.7 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.7/',
- from: '/docs/3.7/**',
- },
- // Redirect for 3.6 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.6/',
- from: '/docs/3.6/**',
- },
- // Redirect for 3.5 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.5/',
- from: '/docs/3.5/**',
- },
- // Redirect for 3.4 docs
- {
- to: 'https://scalardb.scalar-labs.com/docs/3.4/',
- from: '/docs/3.4/**',
- },
],
},
],