Skip to content

Commit f729312

Browse files
authored
Merge pull request #246 from json-schema-org/benjagm-submodule-community
Publish the sponsors packages
2 parents c60e7c5 + 3d6b0b6 commit f729312

File tree

8 files changed

+50
-4
lines changed

8 files changed

+50
-4
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@
3434
path = _includes/draft/2020-12
3535
url = https://github.com/json-schema-org/json-schema-spec.git
3636
branch = 2020-12
37+
[submodule "_includes/community"]
38+
path = _includes/community
39+
url = https://github.com/json-schema-org/community.git

_includes/community

Submodule community added at cf4d4ae

components/DocsHelp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22

33
export const DocsHelp = () => {
44
return (
5-
<div className='flex flex-col rounded-md shadow-md border border-gray-200 p-4 mt-16'>
5+
<div className='flex flex-col rounded-md shadow-md border border-gray-200 p-4 mt-10 mb-3'>
66
<h3 className='flex text-h5mobile md:text-h5 border-b font-semibold pb-3'>
77
<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='currentColor' className='bi bi-info-circle-fill mr-3' viewBox='0 0 16 16'>
88
<path d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z' />

components/Sidebar.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ const SegmentSubtitle = ({ label }: { label: string }) => {
4848
)
4949
}
5050
const getDocsPath = [
51-
'/overview/what-is-jsonschema'
51+
'/overview/what-is-jsonschema',
52+
'/overview/sponsors'
5253
]
5354
const getStartedPath = [
5455
'/learn/json-schema-examples',
@@ -202,6 +203,7 @@ export const DocsNav = () => {
202203
id='overview'
203204
>
204205
<DocLink uri='/overview/what-is-jsonschema' label='What is JSON Schema?' />
206+
<DocLink uri='/overview/sponsors' label='Sponsors' />
205207
</div>
206208
</div>
207209
{/* Get Started */}

lib/getStaticMarkdownPaths.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async function getStaticMarkdownPaths(path: string) {
66
.filter(file => {
77
const isMarkdownFile = file.substr(-3) === '.md'
88
const isProtected = ['_'].includes(file.substr(0, 1))
9-
return isMarkdownFile && !isProtected
9+
return isMarkdownFile && !isProtected
1010
})
1111
.map((fileName) => ({
1212
params: {

lib/getStaticMarkdownProps.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ type Props = { params?: { slug: string }}
55

66
export default async function getStaticMarkdownProps(props: Props, path: string) {
77
const slug = props.params?.slug || '_index'
8-
const fileName = fs.readFileSync(`${path}/${slug}.md`, 'utf-8')
8+
9+
const fileName2 = `${path}/${slug}.md`
10+
const fileName = fs.readFileSync(fileName2, 'utf-8')
11+
912
const { data: frontmatter, content } = matter(fileName)
13+
1014
return {
1115
props: {
1216
frontmatter,

pages/overview/sponsors/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../_includes/community/programs/sponsors/sponsors.md
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import React from 'react'
2+
import { getLayout } from '~/components/Sidebar'
3+
import fs from 'fs'
4+
import Head from 'next/head'
5+
import { Headline1 } from '~/components/Headlines'
6+
import matter from 'gray-matter'
7+
import StyledMarkdown from '~/components/StyledMarkdown'
8+
import { DocsHelp } from '~/components/DocsHelp'
9+
import { SectionContext } from '~/context'
10+
11+
export async function getStaticProps() {
12+
const block1 = fs.readFileSync('pages/overview/sponsors/_index.md', 'utf-8')
13+
const { content: block1Content } = matter(block1)
14+
return {
15+
props: {
16+
blocks: [block1Content]
17+
}
18+
}
19+
}
20+
21+
export default function ContentExample ({ blocks }: { blocks: any[] }) {
22+
const newTitle = 'Sponsors'
23+
24+
return (
25+
<SectionContext.Provider value='docs'>
26+
<Head>
27+
<title>{newTitle}</title>
28+
</Head>
29+
<Headline1>{newTitle}</Headline1>
30+
<StyledMarkdown markdown={blocks[0]} />
31+
<DocsHelp />
32+
</SectionContext.Provider>
33+
)
34+
}
35+
ContentExample.getLayout = getLayout

0 commit comments

Comments
 (0)