diff --git a/components/DocsHelp.tsx b/components/DocsHelp.tsx
index 544189b77..8fa21d48b 100644
--- a/components/DocsHelp.tsx
+++ b/components/DocsHelp.tsx
@@ -3,18 +3,34 @@ import React, { FormEvent, useRef, useState } from 'react';
import extractPathWithoutFragment from '~/lib/extractPathWithoutFragment';
interface DocsHelpProps {
- markdownFile?: string;
+ fileRenderType?: '_indexmd' | 'indexmd' | 'tsx' | '_md' | string;
+ showEditOption?: boolean;
}
-
-export function DocsHelp({ markdownFile }: DocsHelpProps) {
+export function DocsHelp({
+ fileRenderType,
+ showEditOption = true,
+}: DocsHelpProps) {
const router = useRouter();
- const path = encodeURIComponent(router.pathname);
const [isFormOpen, setIsFormOpen] = useState(false);
const [feedbackStatus, setFeedbackStatus] = useState('');
const [isSubmitting, setIsSubmitting] = useState(false);
const [error, setError] = useState('');
const feedbackFormRef = useRef(null);
-
+ let gitredirect = '';
+ if (
+ typeof fileRenderType === 'string' &&
+ fileRenderType.startsWith('https://')
+ ) {
+ gitredirect = fileRenderType;
+ } else if (fileRenderType === 'tsx') {
+ gitredirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(router.asPath) + '/index.page.tsx'}`;
+ } else if (fileRenderType === '_indexmd') {
+ gitredirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(router.asPath) + '/_index.md'}`;
+ } else if (fileRenderType === 'indexmd') {
+ gitredirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(router.asPath) + '/index.md'}`;
+ } else {
+ gitredirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(router.asPath) + '.md'}`;
+ }
async function createFeedbackHandler(event: FormEvent) {
event.preventDefault();
const formData = new FormData(feedbackFormRef.current!);
@@ -296,28 +312,30 @@ export function DocsHelp({ markdownFile }: DocsHelpProps) {
type of contribution!
-
+
+ Edit this page on Github
+
+
+ )}
{
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let mockRouter: MockRouter;
+ const extractPathWithoutFragment = (path: any) => path.split('#')[0];
// Note: we are not using the mockRouter in this test file, but it is required to mock the router in the component file
beforeEach(() => {
- const markdownFile = '_index';
+ const fileRenderType = 'indexmd';
mockRouter = mockNextRouter();
cy.viewport(1200, 800);
- cy.mount();
+ cy.mount();
});
// should render the component correctly
it('should render the component correctly', () => {
// Check if the main component wrapper is present
+ cy.mount();
cy.get(DOCS_HELP).should('exist');
// "Need Help?" header
cy.get('[data-test="need-help-heading"]')
.should('have.prop', 'tagName', 'H2')
- .and('contains', /Need Help?/i);
+ .and('contain.text', 'Need Help?');
// Main feedback question
cy.get('[data-test="feedback-main-heading"]')
.should('have.prop', 'tagName', 'H3')
- .and('contains', /Did you find these docs helpful?/i);
+ .and('contain.text', 'Did you find these docs helpful?');
// Feedback form element
cy.get(FEEDBACK_FORM).should('have.prop', 'tagName', 'FORM');
@@ -50,20 +52,17 @@ describe('DocsHelp Component', () => {
// "Help us improve" section header
cy.get('[data-test="contribute-docs-heading"]')
.should('have.prop', 'tagName', 'H3')
- .and('contains', /Help us make our docs great!/i);
+ .and('contain.text', 'Help us make our docs great!');
// Contribution encouragement text
cy.get('[data-test="contribute-docs-description"]')
.should('have.prop', 'tagName', 'P')
- .and(
- 'contains',
- /At JSON Schema, we value docs contributions as much as every other type of contribution!/i,
- );
+ .and('contain.text', 'At JSON Schema, we value docs contributions');
// "Edit on GitHub" link
cy.get('[data-test="edit-on-github-link"]')
.should('have.prop', 'tagName', 'A')
- .and('contains', /Edit this page on Github/i);
+ .and('contain.text', 'Edit this page on Github');
// "Learn to contribute" link
cy.get('[data-test="learn-to-contribute-link"]')
@@ -73,20 +72,17 @@ describe('DocsHelp Component', () => {
'href',
'https://github.com/json-schema-org/website/blob/main/CONTRIBUTING.md',
)
- .and('contains', /Learn how to contribute/i);
+ .and('contain.text', 'Learn how to contribute');
// "Still Need Help?" section header
cy.get('[data-test="additional-help-heading"]')
.should('have.prop', 'tagName', 'H3')
- .and('contains', /Still Need Help?/i);
+ .and('contain.text', 'Still Need Help?');
// Additional help description
cy.get('[data-test="additional-help-description"]')
.should('have.prop', 'tagName', 'P')
- .should(
- 'contains',
- /Learning JSON Schema is often confusing, but don't worry, we are here to help!./i,
- );
+ .and('contain.text', 'Learning JSON Schema is often confusing');
// GitHub community link
cy.get('[ data-test="ask-on-github-link"]')
@@ -96,7 +92,7 @@ describe('DocsHelp Component', () => {
'href',
'https://github.com/orgs/json-schema-org/discussions/new?category=q-a',
)
- .and('contains', /Ask the community on GitHub/i);
+ .and('contain.text', 'Ask the community on GitHub');
// Slack community link
cy.get('[data-test="ask-on-slack-link"]')
@@ -237,15 +233,51 @@ describe('DocsHelp Component', () => {
});
// This test is to check component render correctly with different markdown files
- it('should render component with different markdown files', () => {
- /* Note: Already checking with _index markdown file in the first test case */
-
- // render with _indexPage markdown file
- const markdownFile = '_indexPage';
- cy.mount();
- cy.get(DOCS_HELP).should('exist');
-
- // render without any markdown file
- cy.mount();
+ it('should render component with different markdown files and validate gitredirect', () => {
+ const fileRenderTypes: ('tsx' | 'indexmd' | '_indexmd' | '_md')[] = [
+ 'tsx',
+ '_indexmd',
+ 'indexmd',
+ '_md',
+ ];
+
+ fileRenderTypes.forEach((type) => {
+ let expectedGitRedirect = '';
+ if (typeof type === 'string' && type.startsWith('https://')) {
+ expectedGitRedirect = type;
+ } else if (type === 'tsx') {
+ expectedGitRedirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(mockRouter.asPath) + '/index.page.tsx'}`;
+ } else if (type === '_indexmd') {
+ expectedGitRedirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(mockRouter.asPath) + '/_index.md'}`;
+ } else if (type === 'indexmd') {
+ expectedGitRedirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(mockRouter.asPath) + '/index.md'}`;
+ } else {
+ expectedGitRedirect = `https://github.com/json-schema-org/website/blob/main/pages${extractPathWithoutFragment(mockRouter.asPath) + '.md'}`;
+ }
+ cy.mount();
+
+ cy.get('[data-test="edit-on-github-link"]').should(
+ 'have.attr',
+ 'href',
+ expectedGitRedirect,
+ );
+ });
+ const customLink = 'https://example.com/custom-docs';
+ cy.mount();
+ cy.get('[data-test="edit-on-github-link"]').should(
+ 'have.attr',
+ 'href',
+ customLink,
+ );
+ });
+ // Check if the "Edit on GitHub" link is present when showEditOption is true
+ it('should render the "Edit on GitHub" link when showEditOption is true', () => {
+ cy.mount();
+ cy.get('[data-test="edit-on-github-link"]').should('exist');
+ });
+ // Check if the "Edit on GitHub" link is not present when showEditOption is false
+ it('should not render the "Edit on GitHub" link when showEditOption is false', () => {
+ cy.mount();
+ cy.get('[data-test="edit-on-github-link"]').should('not.exist');
});
});
diff --git a/pages/[slug].page.tsx b/pages/[slug].page.tsx
index e5b50c255..7a9e7726e 100644
--- a/pages/[slug].page.tsx
+++ b/pages/[slug].page.tsx
@@ -23,7 +23,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -38,7 +38,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/docs/index.page.tsx b/pages/docs/index.page.tsx
index 635f55cf1..f77c33782 100644
--- a/pages/docs/index.page.tsx
+++ b/pages/docs/index.page.tsx
@@ -8,6 +8,7 @@ import { DocsHelp } from '~/components/DocsHelp';
export default function Welcome() {
const newTitle = 'Welcome';
+ const fileRenderType = 'tsx';
return (
@@ -56,7 +57,7 @@ export default function Welcome() {
link='/specification'
/>
-
+
);
}
diff --git a/pages/draft-05/index.page.tsx b/pages/draft-05/index.page.tsx
index 1d619e0b4..a792cfc05 100644
--- a/pages/draft-05/index.page.tsx
+++ b/pages/draft-05/index.page.tsx
@@ -33,13 +33,14 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
+ const fileRenderType = 'indexmd';
return (
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft-06/[slug].page.tsx b/pages/draft-06/[slug].page.tsx
index fc447db63..64655ed3c 100644
--- a/pages/draft-06/[slug].page.tsx
+++ b/pages/draft-06/[slug].page.tsx
@@ -22,7 +22,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -32,7 +32,7 @@ export default function StaticMarkdownPage({
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft-06/index.page.tsx b/pages/draft-06/index.page.tsx
index 12127285b..b328e38ae 100644
--- a/pages/draft-06/index.page.tsx
+++ b/pages/draft-06/index.page.tsx
@@ -31,12 +31,13 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
+ const fileRenderType = 'indexmd';
return (
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft-07/[slug].page.tsx b/pages/draft-07/[slug].page.tsx
index be10dfdba..f4ef2b082 100644
--- a/pages/draft-07/[slug].page.tsx
+++ b/pages/draft-07/[slug].page.tsx
@@ -22,7 +22,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -32,7 +32,7 @@ export default function StaticMarkdownPage({
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft-07/index.page.tsx b/pages/draft-07/index.page.tsx
index 91d52a981..c057e259c 100644
--- a/pages/draft-07/index.page.tsx
+++ b/pages/draft-07/index.page.tsx
@@ -31,12 +31,13 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
+ const fileRenderType = 'indexmd';
return (
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft/2019-09/[slug].page.tsx b/pages/draft/2019-09/[slug].page.tsx
index d7d289a2e..26acaf0e1 100644
--- a/pages/draft/2019-09/[slug].page.tsx
+++ b/pages/draft/2019-09/[slug].page.tsx
@@ -22,7 +22,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -32,7 +32,7 @@ export default function StaticMarkdownPage({
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft/2019-09/index.page.tsx b/pages/draft/2019-09/index.page.tsx
index 14fb022f2..c8e7f3e2d 100644
--- a/pages/draft/2019-09/index.page.tsx
+++ b/pages/draft/2019-09/index.page.tsx
@@ -30,12 +30,13 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
+ const fileRenderType = 'indexmd';
return (
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft/2020-12/[slug].page.tsx b/pages/draft/2020-12/[slug].page.tsx
index 52734da09..cc2331502 100644
--- a/pages/draft/2020-12/[slug].page.tsx
+++ b/pages/draft/2020-12/[slug].page.tsx
@@ -22,7 +22,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -32,7 +32,7 @@ export default function StaticMarkdownPage({
{frontmatter.title}
-
+
);
}
diff --git a/pages/draft/2020-12/index.page.tsx b/pages/draft/2020-12/index.page.tsx
index 4446b9c1b..30e21a5bd 100644
--- a/pages/draft/2020-12/index.page.tsx
+++ b/pages/draft/2020-12/index.page.tsx
@@ -30,12 +30,13 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
+ const fileRenderType = 'indexmd';
return (
{frontmatter.title}
-
+
);
}
diff --git a/pages/implementers/[slug].page.tsx b/pages/implementers/[slug].page.tsx
index 2006baa1f..c149e95eb 100644
--- a/pages/implementers/[slug].page.tsx
+++ b/pages/implementers/[slug].page.tsx
@@ -23,7 +23,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -38,7 +38,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/implementers/index.page.tsx b/pages/implementers/index.page.tsx
index 0b4f034ea..6b056bd06 100644
--- a/pages/implementers/index.page.tsx
+++ b/pages/implementers/index.page.tsx
@@ -17,7 +17,6 @@ export async function getStaticProps() {
},
};
}
-
export default function ContentExample({
blocks,
}: {
@@ -25,8 +24,7 @@ export default function ContentExample({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_indexPage';
-
+ const fileRenderType = '_indexmd';
return (
@@ -58,7 +56,7 @@ export default function ContentExample({
nextLabel='Common Interfaces across Implementations'
nextURL='/implementers/interfaces'
/>
-
+
);
}
diff --git a/pages/learn/[slug].page.tsx b/pages/learn/[slug].page.tsx
index 7065699f3..d186f1a4d 100644
--- a/pages/learn/[slug].page.tsx
+++ b/pages/learn/[slug].page.tsx
@@ -23,7 +23,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -38,7 +38,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/learn/getting-started-step-by-step/index.page.tsx b/pages/learn/getting-started-step-by-step/index.page.tsx
index a56351ed8..2b83572f5 100644
--- a/pages/learn/getting-started-step-by-step/index.page.tsx
+++ b/pages/learn/getting-started-step-by-step/index.page.tsx
@@ -37,7 +37,7 @@ export default function StyledValidator({
content: any;
}) {
const newTitle = 'Creating your first schema';
-
+ const fileRenderType = 'tsx';
return (
@@ -53,7 +53,7 @@ export default function StyledValidator({
nextLabel='Miscellaneous examples'
nextURL='/learn/miscellaneous-examples'
/>
-
+
);
}
diff --git a/pages/learn/index.page.tsx b/pages/learn/index.page.tsx
index 09a897f74..d1e98701b 100644
--- a/pages/learn/index.page.tsx
+++ b/pages/learn/index.page.tsx
@@ -8,7 +8,7 @@ import { DocsHelp } from '~/components/DocsHelp';
import NextPrevButton from '~/components/NavigationButtons';
export default function Welcome() {
- const markdownFile = '_indexPage';
+ const fileRenderType = 'tsx';
const newTitle = 'Getting Started';
return (
@@ -46,7 +46,7 @@ export default function Welcome() {
nextLabel='Creating your first Schema'
nextURL='/learn/getting-started-step-by-step'
/>
-
+
);
}
diff --git a/pages/overview/[slug].page.tsx b/pages/overview/[slug].page.tsx
index 72db35309..c50fa4f39 100644
--- a/pages/overview/[slug].page.tsx
+++ b/pages/overview/[slug].page.tsx
@@ -23,7 +23,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -39,7 +39,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter.next.label}
nextURL={frontmatter.next.url}
/>
-
+
);
}
diff --git a/pages/overview/case-studies/index.page.tsx b/pages/overview/case-studies/index.page.tsx
index a76fdf3a1..239d551cd 100644
--- a/pages/overview/case-studies/index.page.tsx
+++ b/pages/overview/case-studies/index.page.tsx
@@ -11,7 +11,7 @@ import NextPrevButton from '~/components/NavigationButtons';
export default function ContentExample() {
const newTitle = 'Case Studies';
- const markdownFile = '_indexPage';
+ const fileRenderType = 'tsx';
const { resolvedTheme } = useTheme();
const imgUrl = (src: string): string => {
@@ -52,7 +52,7 @@ export default function ContentExample() {
nextLabel='FAQs'
nextURL='/overview/faq'
/>
-
+
);
}
diff --git a/pages/overview/code-of-conduct/index.page.tsx b/pages/overview/code-of-conduct/index.page.tsx
index c4f5526ff..75e6000f2 100644
--- a/pages/overview/code-of-conduct/index.page.tsx
+++ b/pages/overview/code-of-conduct/index.page.tsx
@@ -29,7 +29,8 @@ export default function Content({
content: any;
}) {
const newTitle = 'Code of Conduct';
-
+ const fileRenderType =
+ 'https://github.com/json-schema-org/.github/blob/main/CODE_OF_CONDUCT.md';
return (
@@ -42,7 +43,7 @@ export default function Content({
nextLabel='Getting Started'
nextURL='/learn'
/>
-
+
);
}
diff --git a/pages/overview/faq/index.page.tsx b/pages/overview/faq/index.page.tsx
index b47a3f570..08a3fad64 100644
--- a/pages/overview/faq/index.page.tsx
+++ b/pages/overview/faq/index.page.tsx
@@ -9,7 +9,7 @@ import NextPrevButton from '~/components/NavigationButtons';
export default function Content() {
const newTitle = 'FAQ';
- const markdownFile = '_indexPage';
+ const fileRenderType = 'tsx';
return (
@@ -29,7 +29,7 @@ export default function Content() {
nextLabel='Similar Technologies'
nextURL='/overview/similar-technologies'
/>
-
+
);
}
diff --git a/pages/overview/roadmap/index.page.tsx b/pages/overview/roadmap/index.page.tsx
index ed360f9af..e22e358f5 100644
--- a/pages/overview/roadmap/index.page.tsx
+++ b/pages/overview/roadmap/index.page.tsx
@@ -35,7 +35,7 @@ const impactColors = {
export default function Roadmap() {
const newTitle = 'JSON Schema Roadmap';
- const markdownFile = '_indexPage';
+ const fileRenderType = 'tsx';
return (
@@ -137,7 +137,7 @@ export default function Roadmap() {
nextLabel='Sponsors'
nextURL='/overview/sponsors'
/>
-
+
);
}
diff --git a/pages/overview/sponsors/index.page.tsx b/pages/overview/sponsors/index.page.tsx
index a3ab3dba9..c3c59d4ee 100644
--- a/pages/overview/sponsors/index.page.tsx
+++ b/pages/overview/sponsors/index.page.tsx
@@ -21,7 +21,8 @@ export async function getStaticProps() {
export default function ContentExample({ blocks }: { blocks: any[] }) {
const newTitle = 'Sponsors';
-
+ const fileRenderType =
+ 'https://github.com/json-schema-org/community/blob/main/programs/sponsors/sponsors.md';
return (
@@ -35,7 +36,7 @@ export default function ContentExample({ blocks }: { blocks: any[] }) {
nextLabel='Use Cases'
nextURL='/overview/use-cases'
/>
-
+
);
}
diff --git a/pages/overview/use-cases/index.page.tsx b/pages/overview/use-cases/index.page.tsx
index 1c77df4cc..466a59158 100644
--- a/pages/overview/use-cases/index.page.tsx
+++ b/pages/overview/use-cases/index.page.tsx
@@ -10,7 +10,7 @@ import NextPrevButton from '~/components/NavigationButtons';
export default function Content() {
const newTitle = 'Use Cases';
- const markdownFile = '_indexPage';
+ const fileRenderType = 'tsx';
return (
@@ -42,7 +42,7 @@ export default function Content() {
nextLabel='Case Studies'
nextURL='/overview/case-studies'
/>
-
+
);
}
diff --git a/pages/specification/json-hyper-schema/index.page.tsx b/pages/specification/json-hyper-schema/index.page.tsx
index 84892ff74..83d5376d8 100644
--- a/pages/specification/json-hyper-schema/index.page.tsx
+++ b/pages/specification/json-hyper-schema/index.page.tsx
@@ -36,7 +36,7 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
- const markdownFile = '_indexPage';
+ const fileRenderType = '_indexmd';
return (
{frontmatter.title}
@@ -51,7 +51,7 @@ export default function ImplementationsPages({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/specification/migration/index.page.tsx b/pages/specification/migration/index.page.tsx
index c2a53b5e3..8afad3be4 100644
--- a/pages/specification/migration/index.page.tsx
+++ b/pages/specification/migration/index.page.tsx
@@ -37,7 +37,7 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
- const markdownFile = '_indexPage';
+ const fileRenderType = '_indexmd';
return (
{frontmatter.title}
@@ -79,7 +79,7 @@ export default function ImplementationsPages({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/specification/release-notes/index.page.tsx b/pages/specification/release-notes/index.page.tsx
index 9a7029188..bce092d47 100644
--- a/pages/specification/release-notes/index.page.tsx
+++ b/pages/specification/release-notes/index.page.tsx
@@ -37,7 +37,7 @@ export default function ImplementationsPages({
blocks: any;
frontmatter: any;
}) {
- const markdownFile = '_indexPage';
+ const fileRenderType = '_indexmd';
return (
{frontmatter.title}
@@ -86,7 +86,7 @@ export default function ImplementationsPages({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/understanding-json-schema/[slug].page.tsx b/pages/understanding-json-schema/[slug].page.tsx
index 3c09f4669..a6d730862 100644
--- a/pages/understanding-json-schema/[slug].page.tsx
+++ b/pages/understanding-json-schema/[slug].page.tsx
@@ -23,7 +23,7 @@ export default function StaticMarkdownPage({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_index';
+ const fileRenderType = '_md';
const newTitle = 'JSON Schema - ' + frontmatter.title;
return (
@@ -38,7 +38,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/understanding-json-schema/index.page.tsx b/pages/understanding-json-schema/index.page.tsx
index 546e25018..40ed5c449 100644
--- a/pages/understanding-json-schema/index.page.tsx
+++ b/pages/understanding-json-schema/index.page.tsx
@@ -19,7 +19,6 @@ export async function getStaticProps() {
},
};
}
-
export default function ContentExample({
blocks,
}: {
@@ -27,8 +26,7 @@ export default function ContentExample({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_indexPage';
-
+ const fileRenderType = '_indexmd';
return (
@@ -38,7 +36,7 @@ export default function ContentExample({
nextLabel='Conventions used'
nextURL='/understanding-json-schema/conventions'
/>
-
+
);
}
diff --git a/pages/understanding-json-schema/keywords/index.page.tsx b/pages/understanding-json-schema/keywords/index.page.tsx
index d1988d505..29c077862 100644
--- a/pages/understanding-json-schema/keywords/index.page.tsx
+++ b/pages/understanding-json-schema/keywords/index.page.tsx
@@ -39,7 +39,7 @@ interface LinkObject {
}
export default function StaticMarkdownPage({ datas }: { datas: DataObject[] }) {
- const markdownFile = '_index';
+ const fileRenderType = 'tsx';
return (
@@ -93,7 +93,7 @@ export default function StaticMarkdownPage({ datas }: { datas: DataObject[] }) {
nextLabel='Understanding JSON Schema'
nextURL='/understanding-json-schema'
/>
-
+
);
}
diff --git a/pages/understanding-json-schema/reference/[slug].page.tsx b/pages/understanding-json-schema/reference/[slug].page.tsx
index 94a13a954..dc87fef98 100644
--- a/pages/understanding-json-schema/reference/[slug].page.tsx
+++ b/pages/understanding-json-schema/reference/[slug].page.tsx
@@ -27,7 +27,7 @@ export default function StaticMarkdownPage({
content: any;
}) {
const newTitle = 'JSON Schema - ' + frontmatter.title;
- const markdownFile = '_index';
+ const fileRenderType = '_md';
return (
@@ -41,7 +41,7 @@ export default function StaticMarkdownPage({
nextLabel={frontmatter?.next?.label}
nextURL={frontmatter?.next?.url}
/>
-
+
);
}
diff --git a/pages/understanding-json-schema/reference/index.page.tsx b/pages/understanding-json-schema/reference/index.page.tsx
index e14bdf13b..d1083acc6 100644
--- a/pages/understanding-json-schema/reference/index.page.tsx
+++ b/pages/understanding-json-schema/reference/index.page.tsx
@@ -27,7 +27,7 @@ export default function ContentExample({
frontmatter: any;
content: any;
}) {
- const markdownFile = '_indexPage';
+ const fileRenderType = '_indexmd';
return (
@@ -37,7 +37,7 @@ export default function ContentExample({
nextLabel='Type-specific keywords'
nextURL='/understanding-json-schema/reference/type'
/>
-
+
);
}