Skip to content

Commit 72ae168

Browse files
Added navigation buttons in other sections of website (#1218)
1 parent 8f2c85f commit 72ae168

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+315
-12
lines changed

pages/[slug].page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps';
77
import { Headline1 } from '~/components/Headlines';
88
import { SectionContext } from '~/context';
99
import { DocsHelp } from '~/components/DocsHelp';
10+
import NextPrevButton from '~/components/NavigationButtons';
1011

1112
export async function getStaticPaths() {
1213
return getStaticMarkdownPaths('pages');
@@ -31,6 +32,12 @@ export default function StaticMarkdownPage({
3132
</Head>
3233
<Headline1>{frontmatter.title}</Headline1>
3334
<StyledMarkdown markdown={content} />
35+
<NextPrevButton
36+
prevLabel={frontmatter?.prev?.label}
37+
prevURL={frontmatter?.prev?.url}
38+
nextLabel={frontmatter?.next?.label}
39+
nextURL={frontmatter?.next?.url}
40+
/>
3441
<DocsHelp markdownFile={markdownFile} />
3542
</SectionContext.Provider>
3643
);

pages/implementers/[slug].page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps';
77
import { Headline1 } from '~/components/Headlines';
88
import { SectionContext } from '~/context';
99
import { DocsHelp } from '~/components/DocsHelp';
10+
import NextPrevButton from '~/components/NavigationButtons';
1011

1112
export async function getStaticPaths() {
1213
return getStaticMarkdownPaths('pages/implementers');
@@ -31,6 +32,12 @@ export default function StaticMarkdownPage({
3132
</Head>
3233
<Headline1>{frontmatter.title}</Headline1>
3334
<StyledMarkdown markdown={content} />
35+
<NextPrevButton
36+
prevLabel={frontmatter?.prev?.label}
37+
prevURL={frontmatter?.prev?.url}
38+
nextLabel={frontmatter?.next?.label}
39+
nextURL={frontmatter?.next?.url}
40+
/>
3441
<DocsHelp markdownFile={markdownFile} />
3542
</SectionContext.Provider>
3643
);

pages/implementers/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: "For Implementers"
33
section: docs
4+
prev:
5+
label: Structuring a complex schema
6+
url: /understanding-json-schema/structuring
7+
next:
8+
label: Common Interfaces across Implementations
9+
url: /implementers/interfaces
410
---
511

612
For Implementers

pages/implementers/index.page.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import StyledMarkdown from '~/components/StyledMarkdown';
66
import { DocsHelp } from '~/components/DocsHelp';
77
import { SectionContext } from '~/context';
88
import Card from '~/components/Card';
9+
import NextPrevButton from '~/components/NavigationButtons';
910

1011
export async function getStaticProps() {
1112
const block1 = fs.readFileSync('pages/implementers/_index.md', 'utf-8');
@@ -17,13 +18,19 @@ export async function getStaticProps() {
1718
};
1819
}
1920

20-
export default function ContentExample({ blocks }: { blocks: any[] }) {
21+
export default function ContentExample({
22+
blocks,
23+
}: {
24+
blocks: any[];
25+
frontmatter: any;
26+
content: any;
27+
}) {
2128
const markdownFile = '_indexPage';
2229

2330
return (
2431
<SectionContext.Provider value='docs'>
2532
<StyledMarkdown markdown={blocks[0]} />
26-
<section className='mt-10'>
33+
<section className='my-10'>
2734
<div className='grid grid-cols-1 md:grid-cols-2 gap-4 w-12/12 md:w-11/12 lg:w-10/12 xl:w-10/12 m-auto'>
2835
<Card
2936
key='common-interfaces'
@@ -45,6 +52,12 @@ export default function ContentExample({ blocks }: { blocks: any[] }) {
4552
/>
4653
</div>
4754
</section>
55+
<NextPrevButton
56+
prevLabel='Structuring a complex schema'
57+
prevURL='/understanding-json-schema/structuring'
58+
nextLabel='Common Interfaces across Implementations'
59+
nextURL='/implementers/interfaces'
60+
/>
4861
<DocsHelp markdownFile={markdownFile} />
4962
</SectionContext.Provider>
5063
);

pages/implementers/interfaces.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: Common Interfaces across JSON Schema Implementations
33
section: implementers
4+
prev:
5+
label: For Implementers
6+
url: /implementers
7+
next:
8+
label: Specification
9+
url: /specification
410
---
511

612
JSON Schema is extremely widely used and nearly equally widely implemented.

pages/learn/getting-started-step-by-step/getting-started-step-by-step.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: Creating your first schema
33
section: docs
4+
prev:
5+
label: Overview
6+
url: /learn
7+
next:
8+
label: Miscellaneous examples
9+
url: /learn/miscellaneous-examples
410
---
511

612
JSON Schema is a vocabulary that you can use to annotate and validate JSON documents. This tutorial guides you through the process of creating a JSON Schema.

pages/learn/getting-started-step-by-step/index.page.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import StyledMarkdown from '~/components/StyledMarkdown';
99
import { SectionContext } from '~/context';
1010
import { DocsHelp } from '~/components/DocsHelp';
1111
import GettingStarted from '~/components/GettingStarted';
12+
import NextPrevButton from '~/components/NavigationButtons';
1213

1314
export async function getStaticProps() {
1415
const block1 = fs.readFileSync(
@@ -28,7 +29,13 @@ export async function getStaticProps() {
2829
};
2930
}
3031

31-
export default function StyledValidator({ blocks }: { blocks: any[] }) {
32+
export default function StyledValidator({
33+
blocks,
34+
}: {
35+
blocks: any[];
36+
frontmatter: any;
37+
content: any;
38+
}) {
3239
const newTitle = 'Creating your first schema';
3340

3441
return (
@@ -40,6 +47,12 @@ export default function StyledValidator({ blocks }: { blocks: any[] }) {
4047
<StyledMarkdown markdown={blocks[0]} />
4148
<GettingStarted />
4249
<StyledMarkdown markdown={blocks[1]} />
50+
<NextPrevButton
51+
prevLabel='Overview'
52+
prevURL='/learn'
53+
nextLabel='Miscellaneous examples'
54+
nextURL='/learn/miscellaneous-examples'
55+
/>
4356
<DocsHelp />
4457
</SectionContext.Provider>
4558
);

pages/learn/glossary.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
---
22
title: JSON Schema Glossary
33
section: docs
4+
prev:
5+
label: Other Examples
6+
url: /learn/json-schema-examples
7+
next:
8+
label: JSON Schema Keywords
9+
url: /understanding-json-schema/keywords
410
---
511

612
This document collects short explanations of terminology one may encounter within the JSON Schema community.

pages/learn/index.page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Headline1 } from '~/components/Headlines';
55
import { SectionContext } from '~/context';
66
import Card from '~/components/Card';
77
import { DocsHelp } from '~/components/DocsHelp';
8+
import NextPrevButton from '~/components/NavigationButtons';
89

910
export default function Welcome() {
1011
const markdownFile = '_indexPage';
@@ -39,6 +40,12 @@ export default function Welcome() {
3940
link='https://tour.json-schema.org/'
4041
/>
4142
</div>
43+
<NextPrevButton
44+
prevLabel='Code of Conduct'
45+
prevURL='/overview/code-of-conduct'
46+
nextLabel='Creating your first Schema'
47+
nextURL='/learn/getting-started-step-by-step'
48+
/>
4249
<DocsHelp markdownFile={markdownFile} />
4350
</SectionContext.Provider>
4451
);

pages/learn/json-schema-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ prev:
55
label: Modeling a file system
66
url: /learn/file-system
77
next:
8-
label: Miscellaneous examples
9-
url: /learn/miscellaneous-examples
8+
label: JSON Scehma Glossary
9+
url: /learn/glossary
1010
---
1111

1212
In this page, you will find examples illustrating different use cases to help you get the most out of your JSON Schemas. These examples cover a wide range of scenarios, and each example comes with accompanying JSON data and explanation, showcasing how JSON Schemas can be applied to various domains. You can modify these examples to suit your specific needs, as this is just one of the many ways you can utilize JSON Schemas.

0 commit comments

Comments
 (0)