Skip to content

Commit

Permalink
added #anchor support to redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
reganwolfrom committed Nov 28, 2024
1 parent 9e8f515 commit 16d2ec9
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 28 deletions.
5 changes: 3 additions & 2 deletions src/components/redirects/anti-malware-antivirus.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/anti-malware-antivirus');
history.replace('/docs/add-on-modules/modules/anti-malware-antivirus' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/custom-domains.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/custom-domains');
history.replace('/docs/add-on-modules/modules/custom-domains' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/document-generation.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/document-generation');
history.replace('/docs/add-on-modules/modules/document-generation' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/document-versioning.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/document-versioning');
history.replace('/docs/add-on-modules/modules/document-versioning' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/e-signature.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/e-signature');
history.replace('/docs/add-on-modules/modules/e-signature' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/enhanced-document-ocr.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/enhanced-document-ocr');
history.replace('/docs/add-on-modules/modules/enhanced-document-ocr' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/enhanced-fulltext-document-search.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/enhanced-fulltext-document-search');
history.replace('/docs/add-on-modules/modules/enhanced-fulltext-document-search' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/filesync-cli.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/filesync-cli');
history.replace('/docs/add-on-modules/modules/filesync-cli' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/full-encryption.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@


import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/full-encryption');
history.replace('/docs/add-on-modules/modules/full-encryption' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/onlyoffice-document-collaboration.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/onlyoffice-document-collaboration');
history.replace('/docs/add-on-modules/modules/onlyoffice-document-collaboration' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/open-policy-agent.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/open-policy-agent');
history.replace('/docs/add-on-modules/modules/open-policy-agent' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/rulesets.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/rulesets');
history.replace('/docs/add-on-modules/modules/rulesets' + location.hash);
}, []);

return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/single-sign-on-and-custom-jwt-authorizer');
history.replace('/docs/add-on-modules/modules/single-sign-on-and-custom-jwt-authorizer' + location.hash);
}, []);

return null;
Expand Down
5 changes: 3 additions & 2 deletions src/components/redirects/tag-schema.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React, { useEffect } from 'react';
import { useHistory } from '@docusaurus/router';
import { useHistory, useLocation } from '@docusaurus/router';

export default function Redirect() {
const history = useHistory();
const location = useLocation();

useEffect(() => {
history.replace('/docs/add-on-modules/modules/tag-schema');
history.replace('/docs/add-on-modules/modules/tag-schema' + location.hash);
}, []);

return null;
Expand Down

0 comments on commit 16d2ec9

Please sign in to comment.