diff --git a/components/Layout.tsx b/components/Layout.tsx index 6581ccca5..d21207781 100644 --- a/components/Layout.tsx +++ b/components/Layout.tsx @@ -198,7 +198,7 @@ const MainNavigation = () => { /> @@ -289,7 +289,7 @@ const MobileNav = () => { isActive={section === 'specification'} /> diff --git a/components/Sidebar.tsx b/components/Sidebar.tsx index 16ad66826..516993d17 100644 --- a/components/Sidebar.tsx +++ b/components/Sidebar.tsx @@ -89,20 +89,13 @@ const SegmentSubtitle = ({ label }: { label: string }) => { ); }; const getDocsPath = [ - '/overview/what-is-jsonschema', - '/overview/sponsors', - '/overview/case-studies', - '/overview/similar-technologies', - '/overview/use-cases', - '/overview/code-of-conduct', - '/overview/faq', -]; -const getStartedPath = [ - '/learn/json-schema-examples', - '/learn/file-system', - '/learn/miscellaneous-examples', - '/learn/getting-started-step-by-step', + '/introduction/about', + '/introduction/similar-technologies', + '/introduction/what-is-jsonschema', + '/introduction/getting-started-step-by-step', ]; +const getConceptsPath = ['/concepts/glossary']; + const getReferencePath = [ '/understanding-json-schema', '/understanding-json-schema/basics', @@ -128,7 +121,6 @@ const getReferencePath = [ '/understanding-json-schema/reference/type', '/understanding-json-schema/reference/generic', '/understanding-json-schema/reference', - '/learn/glossary', '/implementers', '/implementers/interfaces', ]; @@ -144,6 +136,19 @@ const getSpecificationPath = [ '/specification', ]; +const getContributionsPath = [ + '/contributions/code-of-conduct', + '/contributions/sponsors', + '/contributions/contributing-to-jsonschema', + '/contributions', +]; + +const getResourcesPath = [ + '/resources/file-system', + '/resources/json-schema-examples', + '/resources/miscellaneous-examples', + '/resources', +]; export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { const router = useRouter(); const [open, setOpen] = useState(false); @@ -174,10 +179,10 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { }} > {getDocsPath.includes(pathWtihoutFragment) && ( -

Overview

+

Introduction

)} - {getStartedPath.includes(pathWtihoutFragment) && ( -

Getting Started

+ {getConceptsPath.includes(pathWtihoutFragment) && ( +

Concepts

)} {getReferencePath.includes(pathWtihoutFragment) && ( @@ -187,6 +192,12 @@ export const SidebarLayout = ({ children }: { children: React.ReactNode }) => { {getSpecificationPath.includes(pathWtihoutFragment) && (

Specification

)} + {getContributionsPath.includes(pathWtihoutFragment) && ( +

Contributions

+ )} + {getResourcesPath.includes(pathWtihoutFragment) && ( +

Resources

+ )} {router.pathname === null && (

Docs

@@ -246,20 +257,26 @@ export const DocsNav = ({ /* eslint-disable no-constant-condition */ const [active, setActive] = useState({ getDocs: false, - getStarted: false, + getConcepts: false, getReference: false, getSpecification: false, + getContributions: false, + getResources: false, }); useEffect(() => { const pathWtihoutFragment = extractPathWithoutFragment(router.asPath); if (getDocsPath.includes(pathWtihoutFragment)) { setActive({ ...active, getDocs: true }); - } else if (getStartedPath.includes(pathWtihoutFragment)) { - setActive({ ...active, getStarted: true }); + } else if (getConceptsPath.includes(pathWtihoutFragment)) { + setActive({ ...active, getConcepts: true }); } else if (getReferencePath.includes(pathWtihoutFragment)) { setActive({ ...active, getReference: true }); } else if (getSpecificationPath.includes(pathWtihoutFragment)) { setActive({ ...active, getSpecification: true }); + } else if (getContributionsPath.includes(pathWtihoutFragment)) { + setActive({ ...active, getContributions: true }); + } else if (getResourcesPath.includes(pathWtihoutFragment)) { + setActive({ ...active, getResources: true }); } }, [router.asPath]); @@ -267,8 +284,8 @@ export const DocsNav = ({ setActive({ ...active, getDocs: !active.getDocs }); }; - const handleClickGet = () => { - setActive({ ...active, getStarted: !active.getStarted }); + const handleClickCon = () => { + setActive({ ...active, getConcepts: !active.getConcepts }); }; const handleClickReference = () => { @@ -279,10 +296,20 @@ export const DocsNav = ({ setActive({ ...active, getSpecification: !active.getSpecification }); }; + const handleClickCont = () => { + setActive({ ...active, getContributions: !active.getContributions }); + }; + + const handleClickResource = () => { + setActive({ ...active, getResources: !active.getResources }); + }; + const rotate = active.getDocs ? 'rotate(180deg)' : 'rotate(0)'; - const rotateG = active.getStarted ? 'rotate(180deg)' : 'rotate(0)'; + const rotateC = active.getConcepts ? 'rotate(180deg)' : 'rotate(0)'; const rotateR = active.getReference ? 'rotate(180deg)' : 'rotate(0)'; const rotateSpec = active.getSpecification ? 'rotate(180deg)' : 'rotate(0)'; + const rotateCont = active.getContributions ? 'rotate(180deg)' : 'rotate(0)'; + const rotateRes = active.getResources ? 'rotate(180deg)' : 'rotate(0)'; const { resolvedTheme } = useTheme(); @@ -313,7 +340,7 @@ export const DocsNav = ({ >
eye icon - +
- {/* Get Started */} + {/* Concepts */}
compass icon - +
- -
- -
+ {/* Reference */}
@@ -475,16 +487,6 @@ export const DocsNav = ({ className={classnames('ml-6', { hidden: !active.getReference })} id='reference' > - - -
+ {/* Specification */}
@@ -655,6 +653,7 @@ export const DocsNav = ({ />
+
+ + {/* Resources */} + +
+
+
+ compass icon + +
+ + + +
+
+
+ + + +
+ + + +
+
+
+
+ + {/* Contributions */} +
+
+
+ compass icon + +
+ + + +
+
+
+ + + + +
+
+
); }; diff --git a/pages/overview/[slug].page.tsx b/pages/concepts/[slug].page.tsx similarity index 91% rename from pages/overview/[slug].page.tsx rename to pages/concepts/[slug].page.tsx index e4d5476d7..819dc2ae4 100644 --- a/pages/overview/[slug].page.tsx +++ b/pages/concepts/[slug].page.tsx @@ -9,10 +9,10 @@ import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticPaths() { - return getStaticMarkdownPaths('pages/overview'); + return getStaticMarkdownPaths('pages/concepts'); } export async function getStaticProps(args: any) { - return getStaticMarkdownProps(args, 'pages/overview'); + return getStaticMarkdownProps(args, 'pages/concepts'); } export default function StaticMarkdownPage({ diff --git a/pages/learn/glossary.md b/pages/concepts/glossary.md similarity index 100% rename from pages/learn/glossary.md rename to pages/concepts/glossary.md diff --git a/pages/contributions/CONTRIBUTING.md b/pages/contributions/CONTRIBUTING.md new file mode 100644 index 000000000..ab9f2471c --- /dev/null +++ b/pages/contributions/CONTRIBUTING.md @@ -0,0 +1,84 @@ +--- +title: Contributing to the JSON Schema documentation +section: docs +--- + +## Welcome + +Welcome to the JSON Schema Contributing Guide, and thank you for your interest. + +This guide will help you get started with the basics of our documentation working processes. + +## Ground rules + +Before working on any contribution, we ask our members to [read our Code of Conduct](../contributions/code-of-conduct) to learn more about our values, behavioral expectations, standards, and rules. + +## Before you start + +To contribute to the JSON Schema documentation you will need to complete the following steps: + +1. [Create a GitHub account](https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github#signing-up-for-a-new-personal-account), if you don't have one already. +2. Read and agree to our Code of Conduct. +3. [Install Node.js v20.9.0+](https://nodejs.org/en/download/package-manager). +4. [Set up environment variables](https://github.com/json-schema-org/website?tab=readme-ov-file#setup-enviroment-variables), like yarn. + +## Community engagement + +To stay updated with news about the JSON Schema project and its documentation, engage with our team, ask questions, and discuss ideas, please [join our Slack workspace](https://json-schema.org/slack) and the following channels: + +**#documentation**: Discuss anything related to the JSON Schema documentation. + +**#community-announcements**: Announce events related to the JSON Schema project and share updates. + +**#anouncements**: This is reserved to announcements from the JSON Schema organization. + +**#website**: Discuss things related to our website. + +**#introductions**: Introduce yourself to the community and get to know other members. + +To learn about what our readers are discussing and their questions about the JSON Schema, we recommend joining the **#stack-overflow** channel, which contains Stack overflow questions tagged with JSON Schema. + + +## Best practices + +This is a list of best practices the JSON Schema project strives and resources we recommend for additional information: + +1. Markdown syntax: Use this [Markdown cheat sheet](https://www.markdownguide.org/cheat-sheet/) for a wuick reference. +2. File naming conventions: We use dashes instead of spaces, and lowercase letters to name .md files. For example: **contributing-guide.md** +3. Commit messages: We recommend reading this comprehensive [step-by-step guide on how to write good commit messages on Git](https://www.freecodecamp.org/news/how-to-write-better-git-commit-messages/). +4. Style guide: We follow the [Google developer documentation style guide](https://developers.google.com/style). + +## Contribution workflow +We value documentation and appreciate efforts to help us improve our documents. There are two ways you can contribute to improve our documentation: + + +1. Work on an existing issue. +2. Propose changes. + +### Work on an existing issue + +To work on an existing issue, go to the [JSON Schema docs board](https://github.com/orgs/json-schema-org/projects/16), where you will find all the open issues related to documentation. + +If the issue you select has no asignees, you can claim the issue by leaving a comment on it and tagging @benjagm who will asignt the issue to you. + +If the issue you select has an asignee already, express your interest in collaborating and tag the asignee instead in the comment. The JSON Schema respects the order in which people claim issues, therefore, you will have to check if the asignee is accepting collaborations. + +After you have been assigned to an issue, [fork the json-schema-org/website repository](https://github.com/json-schema-org/website) and create a new branch to work on your changes. + +### Propose changes + +To propose modifications to our documentation, we invite you to first review our [documentation board](https://github.com/orgs/json-schema-org/projects/16) and make sure no issue has been created for the changes you're proposing. + + If no issue exists, you can [create a GitHub issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue#creating-an-issue-from-a-repository) and select the *Documentation* template. After you create the issue, you can decide whether you want to work on it yourself or let someone else claim it. For working on the issue yourself, tag @benjagm in the comment so he assigns you to it. To work on the changes. + +![Screenshot of available issue templates and a yellow arrow pointing at the Dcoumentation template](../contributions/documentation-template-screenshot.png) + +## Create a Pull Request + +To work on your changes, fork the [json-schema-org/website repository](https://github.com/json-schema-org/website) and create a new branch. Use dashes (-) instead of spaces when naming your branch. When your changes are ready for review, open a pull request to the main branch, and add the issue your pull request solves. Add @benjagm as reviewers and leave a comment asking for a review. + +After your pull request is reviewed by the community and is approved, you will merge your changes into the main branch and your contribution to the project will be complete! + +We created this guide based on templates from [The Good Docs Project](https://www.thegooddocsproject.dev/). + + \ No newline at end of file diff --git a/pages/contributions/[slug].page.tsx b/pages/contributions/[slug].page.tsx new file mode 100644 index 000000000..430da27f8 --- /dev/null +++ b/pages/contributions/[slug].page.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import Head from 'next/head'; +import { getLayout } from '~/components/Sidebar'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; +import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; +import { Headline1 } from '~/components/Headlines'; +import { SectionContext } from '~/context'; +import { DocsHelp } from '~/components/DocsHelp'; + +export async function getStaticPaths() { + return getStaticMarkdownPaths('pages/contributions'); +} +export async function getStaticProps(args: any) { + return getStaticMarkdownProps(args, 'pages/contributions'); +} + +export default function StaticMarkdownPage({ + frontmatter, + content, +}: { + frontmatter: any; + content: any; +}) { + const markdownFile = '_index'; + const newTitle = 'JSON Schema - ' + frontmatter.title; + + return ( + + + {newTitle} + + {frontmatter.title} + + + + ); +} +StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/contributions/_index.md b/pages/contributions/_index.md new file mode 100644 index 000000000..1bf9d2d86 --- /dev/null +++ b/pages/contributions/_index.md @@ -0,0 +1,6 @@ +--- +title: Overview +section: docs +--- + +Here goes the overview of the Community and contributing section \ No newline at end of file diff --git a/pages/overview/code-of-conduct/_index.md b/pages/contributions/code-of-conduct/_index.md similarity index 100% rename from pages/overview/code-of-conduct/_index.md rename to pages/contributions/code-of-conduct/_index.md diff --git a/pages/overview/code-of-conduct/index.page.tsx b/pages/contributions/code-of-conduct/index.page.tsx similarity index 94% rename from pages/overview/code-of-conduct/index.page.tsx rename to pages/contributions/code-of-conduct/index.page.tsx index c4d74033e..074975dd0 100644 --- a/pages/overview/code-of-conduct/index.page.tsx +++ b/pages/contributions/code-of-conduct/index.page.tsx @@ -9,7 +9,7 @@ import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { const block = fs.readFileSync( - 'pages/overview/code-of-conduct/_index.md', + 'pages/contributions/code-of-conduct/_index.md', 'utf-8', ); const { content: blockContent } = matter(block); diff --git a/pages/contributions/documentation-template-screenshot.png b/pages/contributions/documentation-template-screenshot.png new file mode 100644 index 000000000..86dab5cde Binary files /dev/null and b/pages/contributions/documentation-template-screenshot.png differ diff --git a/pages/contributions/index.page.tsx b/pages/contributions/index.page.tsx new file mode 100644 index 000000000..3a5bf2afb --- /dev/null +++ b/pages/contributions/index.page.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { getLayout } from '~/components/Sidebar'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { DocsHelp } from '~/components/DocsHelp'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const block1 = fs.readFileSync('pages/contributions/_index.md', 'utf-8'); + const { content: block1Content } = matter(block1); + return { + props: { + blocks: [block1Content], + }, + }; +} + +export default function ContentExample({ blocks }: { blocks: any[] }) { + const markdownFile = '_indexPage'; + + return ( + + + + + ); +} +ContentExample.getLayout = getLayout; diff --git a/pages/overview/sponsors/_index.md b/pages/contributions/sponsors/_index.md similarity index 100% rename from pages/overview/sponsors/_index.md rename to pages/contributions/sponsors/_index.md diff --git a/pages/overview/sponsors/index.page.tsx b/pages/contributions/sponsors/index.page.tsx similarity index 90% rename from pages/overview/sponsors/index.page.tsx rename to pages/contributions/sponsors/index.page.tsx index a26f1dfe7..7a849c8e4 100644 --- a/pages/overview/sponsors/index.page.tsx +++ b/pages/contributions/sponsors/index.page.tsx @@ -9,7 +9,10 @@ import { SectionContext } from '~/context'; import { DocsHelp } from '~/components/DocsHelp'; export async function getStaticProps() { - const block1 = fs.readFileSync('pages/overview/sponsors/_index.md', 'utf-8'); + const block1 = fs.readFileSync( + 'pages/contributions/sponsors/_index.md', + 'utf-8', + ); const { content: block1Content } = matter(block1); return { props: { diff --git a/pages/introduction/[slug].page.tsx b/pages/introduction/[slug].page.tsx new file mode 100644 index 000000000..1d5ad28e7 --- /dev/null +++ b/pages/introduction/[slug].page.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import Head from 'next/head'; +import { getLayout } from '~/components/Sidebar'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; +import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; +import { Headline1 } from '~/components/Headlines'; +import { SectionContext } from '~/context'; +import { DocsHelp } from '~/components/DocsHelp'; + +export async function getStaticPaths() { + return getStaticMarkdownPaths('pages/introduction'); +} +export async function getStaticProps(args: any) { + return getStaticMarkdownProps(args, 'pages/introduction'); +} + +export default function StaticMarkdownPage({ + frontmatter, + content, +}: { + frontmatter: any; + content: any; +}) { + const markdownFile = '_index'; + const newTitle = 'JSON Schema - ' + frontmatter.title; + + return ( + + + {newTitle} + + {frontmatter.title} + + + + ); +} +StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/introduction/_index.md b/pages/introduction/_index.md new file mode 100644 index 000000000..c8d0279d4 --- /dev/null +++ b/pages/introduction/_index.md @@ -0,0 +1,6 @@ +--- +title: Overview +section: docs +--- + +Here goes the overview of the Introduction section \ No newline at end of file diff --git a/pages/understanding-json-schema/about.md b/pages/introduction/about.md similarity index 100% rename from pages/understanding-json-schema/about.md rename to pages/introduction/about.md diff --git a/pages/learn/getting-started-step-by-step.md b/pages/introduction/getting-started-step-by-step.md similarity index 100% rename from pages/learn/getting-started-step-by-step.md rename to pages/introduction/getting-started-step-by-step.md diff --git a/pages/introduction/index.page.tsx b/pages/introduction/index.page.tsx new file mode 100644 index 000000000..226ccf3c8 --- /dev/null +++ b/pages/introduction/index.page.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { getLayout } from '~/components/Sidebar'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { DocsHelp } from '~/components/DocsHelp'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const block1 = fs.readFileSync('pages/introduction/_index.md', 'utf-8'); + const { content: block1Content } = matter(block1); + return { + props: { + blocks: [block1Content], + }, + }; +} + +export default function ContentExample({ blocks }: { blocks: any[] }) { + const markdownFile = '_indexPage'; + + return ( + + + + + ); +} +ContentExample.getLayout = getLayout; diff --git a/pages/overview/similar-technologies.md b/pages/introduction/similar-technologies.md similarity index 97% rename from pages/overview/similar-technologies.md rename to pages/introduction/similar-technologies.md index c4693704f..838619ffb 100644 --- a/pages/overview/similar-technologies.md +++ b/pages/introduction/similar-technologies.md @@ -1,6 +1,6 @@ --- section: docs -title: Similar Technologies +title: Similar technologies --- While we think that JSON Schema has a unique value proposition, we'd like to provide visibility to other technologies that share similar goals: diff --git a/pages/overview/what-is-jsonschema.md b/pages/introduction/what-is-jsonschema.md similarity index 100% rename from pages/overview/what-is-jsonschema.md rename to pages/introduction/what-is-jsonschema.md diff --git a/pages/resources/[slug].page.tsx b/pages/resources/[slug].page.tsx new file mode 100644 index 000000000..e480a2287 --- /dev/null +++ b/pages/resources/[slug].page.tsx @@ -0,0 +1,39 @@ +import React from 'react'; +import Head from 'next/head'; +import { getLayout } from '~/components/Sidebar'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import getStaticMarkdownPaths from '~/lib/getStaticMarkdownPaths'; +import getStaticMarkdownProps from '~/lib/getStaticMarkdownProps'; +import { Headline1 } from '~/components/Headlines'; +import { SectionContext } from '~/context'; +import { DocsHelp } from '~/components/DocsHelp'; + +export async function getStaticPaths() { + return getStaticMarkdownPaths('pages/resources'); +} +export async function getStaticProps(args: any) { + return getStaticMarkdownProps(args, 'pages/resources'); +} + +export default function StaticMarkdownPage({ + frontmatter, + content, +}: { + frontmatter: any; + content: any; +}) { + const markdownFile = '_index'; + const newTitle = 'JSON Schema - ' + frontmatter.title; + + return ( + + + {newTitle} + + {frontmatter.title} + + + + ); +} +StaticMarkdownPage.getLayout = getLayout; diff --git a/pages/resources/_index.md b/pages/resources/_index.md new file mode 100644 index 000000000..02adc29ab --- /dev/null +++ b/pages/resources/_index.md @@ -0,0 +1,6 @@ +--- +title: Overview +section: docs +--- + +Here goes the overview of the Resources section \ No newline at end of file diff --git a/pages/learn/file-system.md b/pages/resources/file-system.md similarity index 100% rename from pages/learn/file-system.md rename to pages/resources/file-system.md diff --git a/pages/resources/index.page.tsx b/pages/resources/index.page.tsx new file mode 100644 index 000000000..cc7b72b9b --- /dev/null +++ b/pages/resources/index.page.tsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { getLayout } from '~/components/Sidebar'; +import fs from 'fs'; +import matter from 'gray-matter'; +import StyledMarkdown from '~/components/StyledMarkdown'; +import { DocsHelp } from '~/components/DocsHelp'; +import { SectionContext } from '~/context'; + +export async function getStaticProps() { + const block1 = fs.readFileSync('pages/resources/_index.md', 'utf-8'); + const { content: block1Content } = matter(block1); + return { + props: { + blocks: [block1Content], + }, + }; +} + +export default function ContentExample({ blocks }: { blocks: any[] }) { + const markdownFile = '_indexPage'; + + return ( + + + + + ); +} +ContentExample.getLayout = getLayout; diff --git a/pages/learn/json-schema-examples.md b/pages/resources/json-schema-examples.md similarity index 100% rename from pages/learn/json-schema-examples.md rename to pages/resources/json-schema-examples.md diff --git a/pages/learn/miscellaneous-examples.md b/pages/resources/miscellaneous-examples.md similarity index 100% rename from pages/learn/miscellaneous-examples.md rename to pages/resources/miscellaneous-examples.md diff --git a/styles/globals.css b/styles/globals.css index b028c23c3..c4e6acbd7 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -224,6 +224,7 @@ border-radius: 4px; */ margin-top: 4.4rem; } + .top-12 { top: 48px; } @@ -269,4 +270,4 @@ border-radius: 4px; */ body { @apply dark:bg-slate-800 bg-white; } -} +} \ No newline at end of file