Skip to content

Commit 673b59b

Browse files
authored
feat: Updated add "Go Back" and "Up Next" buttons for specification navig… (#1743)
* feat: Updated add Go Back and Up Next buttons for specification navigation * revert unintended formatting changes * revert unintended formatting changes * Final revert unintended formatting changes successfull
1 parent 3a36a44 commit 673b59b

File tree

12 files changed

+74
-9
lines changed

12 files changed

+74
-9
lines changed

pages/draft-05/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ type: docs
55
authors: ['Austin Wright']
66
Metaschema: 'https://json-schema.org/draft-04/schema'
77
Specification: 'https://json-schema.org/draft-05/draft-wright-json-schema-00.pdf'
8+
prev:
9+
label: Draft 06
10+
url: /draft-06
11+
next:
12+
label: Specification Links
13+
url: /specification-links
814
---
915

1016
### Draft-05 Documents

pages/draft-05/index.page.tsx

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

1112
export async function getStaticProps() {
1213
const index = fs.readFileSync('pages/draft-05/index.md', 'utf-8');
@@ -40,6 +41,12 @@ export default function ImplementationsPages({
4041
<DocTable frontmatter={frontmatter} />
4142
<StyledMarkdown markdown={blocks.index} />
4243
<StyledMarkdown markdown={blocks.body} />
44+
<NextPrevButton
45+
prevLabel={frontmatter?.prev?.label}
46+
prevURL={frontmatter?.prev?.url}
47+
nextLabel={frontmatter?.next?.label}
48+
nextURL={frontmatter?.next?.url}
49+
/>
4350
<DocsHelp fileRenderType={fileRenderType} />
4451
</SectionContext.Provider>
4552
);

pages/draft-06/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ type: docs
55
authors: ['Austin Wright', 'Henry Andrews']
66
Metaschema: 'https://json-schema.org/draft-06/schema'
77
Specification: 'https://json-schema.org/draft-06/draft-wright-json-schema-01.html'
8+
prev:
9+
label: Draft 07
10+
url: /draft-07
11+
next:
12+
label: Draft 05
13+
url: /draft-05
814
---
915

1016
### Draft-06 Documents

pages/draft-06/index.page.tsx

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

1112
export async function getStaticProps() {
1213
const index = fs.readFileSync('pages/draft-06/index.md', 'utf-8');
@@ -37,6 +38,12 @@ export default function ImplementationsPages({
3738
<Headline1>{frontmatter.title}</Headline1>
3839
<DocTable frontmatter={frontmatter} />
3940
<StyledMarkdown markdown={blocks.index} />
41+
<NextPrevButton
42+
prevLabel={frontmatter?.prev?.label}
43+
prevURL={frontmatter?.prev?.url}
44+
nextLabel={frontmatter?.next?.label}
45+
nextURL={frontmatter?.next?.url}
46+
/>
4047
<DocsHelp fileRenderType={fileRenderType} />
4148
</SectionContext.Provider>
4249
);

pages/draft-07/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ type: docs
55
authors: ['Austin Wright', 'Henry Andrews']
66
Metaschema: 'https://json-schema.org/draft-07/schema'
77
Specification: 'https://json-schema.org/draft-07/draft-handrews-json-schema-01.html'
8+
prev:
9+
label: Draft 2019-09
10+
url: /draft/2019-09
11+
next:
12+
label: Draft 06
13+
url: /draft-06
814
---
915

1016
### Introduction
@@ -37,5 +43,4 @@ _These were updated without changing functionality or meta-schemas due to a few
3743
- [JSON Schema Release Notes](../draft-07/json-schema-release-notes)
3844
- [JSON Hyper-Schema Release Notes](../draft-07/json-hyper-schema-release-notes)
3945

40-
41-
Note that the draft-handrews-\*-00 versions of JSON Hyper-Schema and Relative JSON Pointer had confusing bugs, and have been replaced by draft-handrews-\*-01 versions. The -00 versions may be found in the [obsolete](obsolete) directory.
46+
Note that the draft-handrews-\*-00 versions of JSON Hyper-Schema and Relative JSON Pointer had confusing bugs, and have been replaced by draft-handrews-\*-01 versions. The -00 versions may be found in the [obsolete](obsolete) directory.

pages/draft-07/index.page.tsx

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

1112
export async function getStaticProps() {
1213
const index = fs.readFileSync('pages/draft-07/index.md', 'utf-8');
@@ -37,6 +38,12 @@ export default function ImplementationsPages({
3738
<Headline1>{frontmatter.title}</Headline1>
3839
<DocTable frontmatter={frontmatter} />
3940
<StyledMarkdown markdown={blocks.index} />
41+
<NextPrevButton
42+
prevLabel={frontmatter?.prev?.label}
43+
prevURL={frontmatter?.prev?.url}
44+
nextLabel={frontmatter?.next?.label}
45+
nextURL={frontmatter?.next?.url}
46+
/>
4047
<DocsHelp fileRenderType={fileRenderType} />
4148
</SectionContext.Provider>
4249
);

pages/draft/2019-09/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ authors:
99
- Greg Dennis
1010
Published: 17 September 2019
1111
Metaschema: https://json-schema.org/draft/2019-09/schema
12+
prev:
13+
label: Draft 2020-12
14+
url: /draft/2020-12
15+
next:
16+
label: Draft 07
17+
url: /draft-07
1218
---
1319

1420
### Introduction
@@ -43,6 +49,7 @@ One significant update is the shift to HTTPS for all meta-schema URIs. While the
4349
- [JSON Schema recommended output schema](https://json-schema.org/draft/2019-09/output/schema)
4450
- [JSON Hyper-Schema recommended output schema](https://json-schema.org/draft/2019-09/output/hyper-schema)
4551
- Output examples
52+
4653
- [JSON Schema verbose output example](https://json-schema.org/draft/2019-09/output/verbose-example)
4754

4855
### Release Notes

pages/draft/2019-09/index.page.tsx

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

1112
export async function getStaticProps() {
1213
const index = fs.readFileSync('pages/draft/2019-09/index.md', 'utf-8');
@@ -36,6 +37,12 @@ export default function ImplementationsPages({
3637
<Headline1>{frontmatter.title}</Headline1>
3738
<DocTable frontmatter={frontmatter} />
3839
<StyledMarkdown markdown={blocks.index} />
40+
<NextPrevButton
41+
prevLabel={frontmatter?.prev?.label}
42+
prevURL={frontmatter?.prev?.url}
43+
nextLabel={frontmatter?.next?.label}
44+
nextURL={frontmatter?.next?.url}
45+
/>
3946
<DocsHelp fileRenderType={fileRenderType} />
4047
</SectionContext.Provider>
4148
);

pages/draft/2020-12/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ type: docs
55
authors: ['Austin Wright', 'Henry Andrews', 'Ben Hutton', 'Greg Dennis']
66
Metaschema: 'https://json-schema.org/draft/2020-12/schema'
77
Specification: 'https://json-schema.org/draft/2020-12/json-schema-core.html'
8+
prev:
9+
label: Specification
10+
url: /specification
11+
next:
12+
label: Draft 2019-09
13+
url: /draft/2019-09
814
---
915

1016
### Introduction
@@ -55,4 +61,4 @@ _These were updated without changing functionality or meta-schemas due to a few
5561

5662
### Release Notes
5763

58-
- [Draft 2020-12 Release Notes](../draft/2020-12/release-notes)
64+
- [Draft 2020-12 Release Notes](../draft/2020-12/release-notes)

pages/draft/2020-12/index.page.tsx

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

1112
export async function getStaticProps() {
1213
const index = fs.readFileSync('pages/draft/2020-12/index.md', 'utf-8');
@@ -36,6 +37,12 @@ export default function ImplementationsPages({
3637
<Headline1>{frontmatter.title}</Headline1>
3738
<DocTable frontmatter={frontmatter} />
3839
<StyledMarkdown markdown={blocks.index} />
40+
<NextPrevButton
41+
prevLabel={frontmatter?.prev?.label}
42+
prevURL={frontmatter?.prev?.url}
43+
nextLabel={frontmatter?.next?.label}
44+
nextURL={frontmatter?.next?.url}
45+
/>
3946
<DocsHelp fileRenderType={fileRenderType} />
4047
</SectionContext.Provider>
4148
);

0 commit comments

Comments
 (0)