Skip to content

Commit 29216f1

Browse files
Merge pull request #160 from blackboard/notfound-redirect
🐛 Fixed NotFound redirect of old slugs
2 parents fb7a567 + a86e80f commit 29216f1

6 files changed

Lines changed: 47 additions & 45 deletions

File tree

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
.docusaurus
3+
.build
4+
build
5+
/dist
6+
/.cache
7+
/.parcel-cache

docs/partners/become-a-partner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: Mark Kauffman
88
sidebar_position: 1
99
---
1010

11-
Our Community partnership level is FREE to developers and provides access to the Learn AMI (Amazon Machine Images) for developers to build REST and LTI applications\*, API limits apply and Behind the Blackboard support is not included. [Community support is available](https://community.blackboard.com).
11+
Our Community partnership level is FREE to developers and provides access to the Learn AMI (Amazon Machine Images) for developers to build REST and LTI applications\*, API limits apply and Behind the Blackboard support is not included. [Community support is available](https://community.anthology.com).
1212

1313
Consider investing in one of our other partnership levels to receive added benefits that help partners deepen integrations, promote solutions, and connect with Blackboard clients. The Blackboard Developers Network (BbDN) is Blackboard’s standard partnership and is available for $3,000 annually. BbDN Partnerships include the following benefits:
1414

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page-redirects.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const customRedirects = {
22
"old-slug": "new-slug",
3-
"/docs/developer-amiaasd": "/docs/developer-ami",
4-
"/docs/developer-ami": "/docs/blackboard/sandbox-envs/developer-ami",
5-
"/docs/developer-amifromvmdk":
6-
"/docs/blackboard/sandbox-envs/convert-the-vmdk-file",
3+
"/docs/developer-ami": "/docs/blackboard/sandbox-envs/welcome",
4+
"/docs/developer-amifromvmdk": "/docs/blackboard/sandbox-envs/welcome",
75
};
86

97
module.exports = customRedirects;

src/theme/NotFound.js

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { useEffect } from "react";
2+
import { useHistory } from "react-router-dom";
3+
import Content from "@theme-original/NotFound/Content";
4+
5+
import customRedirects from "../../../../page-redirects";
6+
7+
export default function ContentWrapper(props) {
8+
const history = useHistory();
9+
10+
useEffect(() => {
11+
const currentUrl = window.location.pathname;
12+
const targetLocation = customRedirects[currentUrl];
13+
14+
if (targetLocation) {
15+
window.history.replaceState({}, "", targetLocation);
16+
history.push(targetLocation);
17+
}
18+
}, [history]);
19+
20+
return (
21+
<>
22+
<Content {...props} />
23+
</>
24+
);
25+
}

0 commit comments

Comments
 (0)