diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index aaadb9df8..6af584ff9 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -436,7 +436,6 @@ export const DocsNav = ({ label='Other examples' setOpen={setOpen} /> - @@ -492,6 +491,11 @@ export const DocsNav = ({ setOpen={setOpen} />
+ - - JSON Schema - Keywords - - JSON Schema Keywords -

- JSON Schema keywords are the building blocks of JSON Schema. They are - used to define the structure of a JSON document -

- -
- {datas - .sort((a: DataObject, b: DataObject) => a.name.localeCompare(b.name)) - .map((data: DataObject, index: number) => ( -
- {data.name} -

- {data.vocabulary.join(', ')} -

-
    - {data.links?.map((link: LinkObject, index: number) => ( -
  • - - {link.title} - -
  • - ))} -
- -
  • - - Learn JSON Schema - external link - -
  • - -
    - ))} -
    - - - - ); -} -StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/understanding-json-schema/keywords/index.page.tsx b/pages/understanding-json-schema/keywords/index.page.tsx new file mode 100644 index 000000000..a7ddfd35d --- /dev/null +++ b/pages/understanding-json-schema/keywords/index.page.tsx @@ -0,0 +1,86 @@ +import React from 'react'; +import Head from 'next/head'; + +import fs from 'fs'; +import { getLayout } from '~/components/Sidebar'; +import yaml from 'js-yaml'; +import { SectionContext } from '~/context'; +import { Headline1, Headline4 } from '~/components/Headlines'; +import { DocsHelp } from '~/components/DocsHelp'; +import Link from 'next/link'; +import Image from 'next/image'; + +export async function getStaticProps() { + const datas = yaml.load(fs.readFileSync('data/keywords.yml', 'utf-8')); + + return { + props: { + datas, + }, + }; +} + +interface DataObject { + name: string; + vocabulary: string[]; + learnjsonschemalink: string; + links?: LinkObject[]; +} + +interface LinkObject { + url: string; + title: string; +} + +export default function StaticMarkdownPage({ datas }: { datas: DataObject[] }) { + const markdownFile = '_index'; + return ( + + + JSON Schema - Keywords + + JSON Schema Keywords +

    + JSON Schema keywords are the building blocks of JSON Schema. They are + used to define the structure of a JSON document +

    + +
    + {datas + .sort((a: DataObject, b: DataObject) => a.name.localeCompare(b.name)) + .map( + (data: DataObject, index: number) => + data.links && ( +
    +
    + {data.name} + + external link + +
    +
      + {data.links?.map((link: LinkObject, index: number) => ( +
    • + + {link.title} + +
    • + ))} +
    +
    + ), + )} +
    + + +
    + ); +} +StaticMarkdownPage.getLayout = getLayout;