Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[📝 Docs]: Enhanced SEO and Structure for /docs/index.page.tsx Documentation (#1242) #1238

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/StyledMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ const StyledMarkdownBlock = ({ markdown }: { markdown: string }) => {
h4: { component: Headline4 },
strong: {
component: ({ children }) => (
<strong className='font-semibold text-slate-800 dark:text-slate-500'>
<strong className='font-semibold text-slate-800 dark:text-slate-200'>
{children}
</strong>
),
Expand Down
110 changes: 67 additions & 43 deletions pages/docs/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,63 +1,87 @@
import React from 'react';
import { getLayout } from '~/components/Sidebar';
import Head from 'next/head';
// import PropTypes from 'prop-types';
import { getLayout } from '~/components/Sidebar';
import { Headline1 } from '~/components/Headlines';
import { SectionContext } from '~/context';
import Card from '~/components/Card';
import { DocsHelp } from '~/components/DocsHelp';
import { SectionContext } from '~/context';

const CARDS_DATA = [
{
icon: '/icons/eye.svg',
title: 'Overview',
body: 'Our Overview provides a high level view of the project, its benefits, the roadmap and other relevant details.',
link: '/overview/what-is-jsonschema',
},
{
icon: '/icons/compass.svg',
title: 'Getting Started',
body: 'Our Getting Started guide walks you through the basics of JSON Schema.',
link: '/learn',
},
{
icon: '/icons/book.svg',
title: 'Reference',
body: 'Our Reference teaches JSON Schema deeply from a beginner to the advanced level.',
link: '/understanding-json-schema',
},
{
icon: '/icons/clipboard.svg',
title: 'Specification',
body: 'Our Specification section documents all versions of JSON Schema specification.',
link: '/specification',
},
];

export default function Welcome() {
const newTitle = 'Welcome';
const PAGE_TITLE = 'Welcome';

const renderCards = () => (
<div className='grid grid-cols-1 md:grid-cols-2 gap-6 mt-8'>
{CARDS_DATA.map((card) => (
<Card
key={card.title}
icon={card.icon}
title={card.title}
body={card.body}
headerSize='medium'
bodyTextSize='small'
link={card.link}
/>
))}
</div>
);

return (
<SectionContext.Provider value='docs'>
<Head>
<title>{newTitle}</title>
<title>{PAGE_TITLE}</title>
<meta
name='description'
content='Learn about JSON Schema - a declarative language for validating JSON documents'
/>
</Head>
<Headline1>{newTitle}</Headline1>
<p>

<Headline1>{PAGE_TITLE}</Headline1>

<p className='mb-6'>
JSON Schema is a declarative language for annotating and validating JSON
documents' structure, constraints, and data types. It provides a way to
standardize and define expectations for JSON data.
<br />
<br />
<span className='font-bold text-[1.3rem]'>Explore the docs</span>
</p>
<div className='w-full lg:w-full grid grid-cols-1 sm:grid-cols-2 gap-6 my-[10px] mx-auto mt-8'>
<Card
icon='/icons/eye.svg'
title='Overview'
body='Our Overview provides a high level view of the project, its benefits, the roadmap and other relevant details.'
headerSize='medium'
bodyTextSize='small'
link='/overview/what-is-jsonschema'
/>
<Card
icon='/icons/compass.svg'
title='Getting Started'
body='Our Getting Started guide walks you through the basics of JSON Schema.'
headerSize='medium'
bodyTextSize='small'
link='/learn'
/>
<Card
icon='/icons/book.svg'
title='Reference'
body='Our Reference teaches JSON Schema deeply from a beginner to the advanced level.'
headerSize='medium'
bodyTextSize='small'
link='/understanding-json-schema'
/>
<Card
icon='/icons/clipboard.svg'
title='Specification'
body='Our Specification section documents all versions of JSON Schema specification.'
headerSize='medium'
bodyTextSize='small'
link='/specification'
/>
</div>

<h2 className='font-bold text-xl mb-4'>Explore the docs</h2>

{renderCards()}

<DocsHelp />
</SectionContext.Provider>
);
}

//layout configuration
Welcome.getLayout = getLayout;

//display name for better debugging
Welcome.displayName = 'Welcome';
Loading