From 4dde180720bfc323eff09c5c9c92183af36d3764 Mon Sep 17 00:00:00 2001
From: Dhairya Majmudar <2022kuec2045@iiitkota.ac.in>
Date: Tue, 13 Aug 2024 19:25:24 +0530
Subject: [PATCH] updating as per feedback
---
components/Sidebar.tsx | 6 +-
pages/keywords/index.page.tsx | 93 -------------------
.../keywords/index.page.tsx | 86 +++++++++++++++++
3 files changed, 91 insertions(+), 94 deletions(-)
delete mode 100644 pages/keywords/index.page.tsx
create mode 100644 pages/understanding-json-schema/keywords/index.page.tsx
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
-
-
-
-
-
- ))}
-
-
-
-
- );
-}
-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}
+
+
+
+
+
+ {data.links?.map((link: LinkObject, index: number) => (
+ -
+
+ {link.title}
+
+
+ ))}
+
+
+ ),
+ )}
+
+
+
+
+ );
+}
+StaticMarkdownPage.getLayout = getLayout;