-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOT-FIX: swizzle NotFoundContent to old docs (#294)
* fix: swizzle NotFoundContent to old docs * chore: add get help discord link
- Loading branch information
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from "react"; | ||
import { useLocation } from "@docusaurus/router"; | ||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; | ||
import styles from "./styles.module.css"; | ||
|
||
// according to docusaurus, unwrap NotFoundContent is danger | ||
// we can undo this after there is no broken link from v1 | ||
export default function ContentWrapper(props) { | ||
const location = useLocation(); | ||
const { siteConfig } = useDocusaurusContext(); | ||
const oldDocUrl = siteConfig.customFields.oldDocSiteUrl; | ||
return ( | ||
<div className={styles.notFoundContainer}> | ||
<h1>Page Not Found</h1> | ||
<p>Are you trying to visit broken links from old doc website?</p> | ||
<h2> | ||
Try{" "} | ||
<a href={oldDocUrl + location.pathname}> | ||
{oldDocUrl + location.pathname} | ||
</a>{" "} | ||
</h2> | ||
<div> | ||
Or get help from <a href="https://discord.gg/nervosnetwork">discord</a> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '@css/customVariables.css'; | ||
|
||
.notFoundContainer { | ||
width: auto; | ||
margin: 0 auto; | ||
padding: 1.5em 1em; | ||
color: var(--text-secondary) !important; | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters