-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): document structure and home page components
- Loading branch information
1 parent
a51d17c
commit 81553cf
Showing
14 changed files
with
216 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
{ | ||
"eslint.experimental.useFlatConfig": true, | ||
"cSpell.words": ["Elems", "iife", "inconnu", "tsup", "Unbekannt", "withtypes"] | ||
"cSpell.words": [ | ||
"clsx", | ||
"Elems", | ||
"iife", | ||
"inconnu", | ||
"nextra", | ||
"tailwindcss", | ||
"tsup", | ||
"Unbekannt", | ||
"withtypes" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useMemo } from 'react' | ||
import pkg from '../../package.json' | ||
|
||
export const Copyright: React.FC = () => { | ||
console.log(pkg) | ||
|
||
const author = useMemo(() => { | ||
const [name] = pkg.author.split(' ') | ||
return name | ||
}, []) | ||
|
||
const github = useMemo(() => { | ||
return `https://github.com/${author}` | ||
}, [author]) | ||
|
||
return ( | ||
<span> | ||
{pkg.license} 2023-PRESENT ©{' '} | ||
<a href={github} target="_blank" rel="noreferrer"> | ||
{author} | ||
</a> | ||
. | ||
</span> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
import React from 'react' | ||
import clsx from 'clsx' | ||
import { WEBSITE_TITLE } from '../constants' | ||
import { Link } from 'nextra-theme-docs' | ||
import { useAppearance } from '../hooks/data-hooks' | ||
|
||
export const Hero: React.FC = () => { | ||
const { isDark } = useAppearance() | ||
|
||
const btnCls = clsx( | ||
'flex flex-shrink-0 items-center justify-center', | ||
'rounded-lg max-w-full h-12 px-6', | ||
'!text-white dark:!text-black', | ||
'bg-slate-900 hover:bg-slate-700', | ||
'dark:bg-zinc-100 dark:highlight-white/20 dark:hover:bg-zinc-200', | ||
'focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 focus:ring-offset-slate-50 ', | ||
'cursor-pointer !no-underline', | ||
) | ||
|
||
return ( | ||
<div className="w-full text-center my-40"> | ||
<h2 className="font-bold headline">{WEBSITE_TITLE}</h2> | ||
<div className="flex flex-col items-center gap-20 w-full text-center my-40"> | ||
<div className="flex flex-col luster"> | ||
<h3 className="headline !text-4xl">ISO 639</h3> | ||
<h2 className="font-bold headline">{WEBSITE_TITLE}</h2> | ||
</div> | ||
|
||
{isDark && <div className="aperture" />} | ||
|
||
<Link className={btnCls} href="/getting-started"> | ||
<span>Get Started</span> | ||
</Link> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react' | ||
import { WEBSITE_TITLE } from '../constants' | ||
|
||
export const Logo: React.FC = () => { | ||
return ( | ||
<div className="flex items-center gap-3"> | ||
<img | ||
className="flex flex-shrink-0 w-6 rounded" | ||
src="/assets/logo.png" | ||
alt={WEBSITE_TITLE} | ||
/> | ||
<span className="luster">{WEBSITE_TITLE}</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { useMemo } from 'react' | ||
import { useTheme } from 'nextra-theme-docs' | ||
import { isServer } from '@bassist/utils' | ||
|
||
export function useAppearance() { | ||
const { resolvedTheme } = useTheme() | ||
|
||
const isDark = useMemo(() => { | ||
if (isServer) return true | ||
return resolvedTheme === 'dark' | ||
}, [resolvedTheme]) | ||
|
||
return { | ||
isDark, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Getting Started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
import { Hero } from '../components/Hero' | ||
|
||
<Hero /> | ||
|
||
# Language Code | ||
|
||
Coming soon... | ||
|
||
<div className="flex">Hello</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
import React from 'react' | ||
import { WEBSITE_TITLE } from './constants' | ||
import { Logo } from './components/Logo' | ||
import { Copyright } from './components/Copyright' | ||
|
||
export default { | ||
logo: ( | ||
<div className="flex items-center gap-3"> | ||
<img | ||
className="flex flex-shrink-0 w-6 rounded" | ||
src="/assets/logo.png" | ||
alt={WEBSITE_TITLE} | ||
/> | ||
<span>{WEBSITE_TITLE}</span> | ||
</div> | ||
), | ||
logo: <Logo />, | ||
primaryHue: 10, | ||
gitTimestamp: false, | ||
footer: { | ||
text: <Copyright />, | ||
}, | ||
project: { | ||
link: 'https://github.com/ISO-639/language-code', | ||
}, | ||
// ... other theme options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.