Skip to content

Commit a2aed9d

Browse files
authored
fix(mdx, template): fix misc problems (#533)
* fix(mdx/doc-home): correct wrong id * fix(template): fix canonical link for archived doc
1 parent c09cbeb commit a2aed9d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/components/MDXComponents/DocHome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ export function DocHomeCard(props: React.PropsWithChildren<DocHomeCardProps>) {
407407
})}
408408
>
409409
<Box
410-
id="card-content"
410+
className="card-content"
411411
sx={(theme) => ({
412412
"& > h3": {
413413
fontSize: "16px",

src/shared/resources.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { StackOverflowIcon, AskTugIcon } from "components/Icons";
1313
import { convertVersionName } from "./utils";
1414
import CONFIG from "../../docs/docs.json";
1515

16+
export const DOC_HOME_URL = "https://docs.pingcap.com";
17+
1618
export const DEFAULT_PINGCAP_URL = `https://www.pingcap.com`;
1719
export const EN_PINGCAP_URL = `https://www.pingcap.com/`;
1820
export const ZH_PINGCAP_URL = `https://cn.pingcap.com/`;

src/templates/DocTemplate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { getStable, generateUrl } from "shared/utils";
2424
import GitCommitInfoCard from "components/Card/GitCommitInfoCard";
2525
import { FeedbackSection } from "components/Card/FeedbackSection";
2626
import { FeedbackSurveyCampaign } from "components/Campaign/FeedbackSurvey";
27+
import { DOC_HOME_URL } from "shared/resources";
2728

2829
interface DocTemplateProps {
2930
pageContext: PageContext & {
@@ -65,7 +66,6 @@ export default function DocTemplate({
6566
data,
6667
}: DocTemplateProps) {
6768
const {
68-
site,
6969
mdx: { frontmatter, tableOfContents, body },
7070
navigation: originNav,
7171
} = data;
@@ -130,7 +130,7 @@ export default function DocTemplate({
130130
? [
131131
{
132132
rel: "canonical",
133-
href: `${site.siteMetadata.siteUrl}${generateUrl(name, {
133+
href: `${DOC_HOME_URL}${generateUrl(name, {
134134
...pathConfig,
135135
version: "stable",
136136
})}`,

0 commit comments

Comments
 (0)