-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: revamp documentation (#196)
Co-authored-by: Valerio Ageno <[email protected]>
- Loading branch information
1 parent
c76464b
commit c491ece
Showing
25 changed files
with
651 additions
and
129 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
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,266 @@ | ||
import type { ReactNode } from 'react' | ||
|
||
interface SidebarElementType<T> { | ||
type: T | ||
} | ||
|
||
interface SidebarLink extends SidebarElementType<'element'> { | ||
label: string | ||
href: string | ||
children?: SidebarLink[] | ||
leftIcon?: ReactNode | ||
} | ||
|
||
interface SidebarTitle extends SidebarElementType<'title'> { | ||
label: string | ||
} | ||
|
||
type SidebarElements = | ||
| SidebarElementType<'divider'> | ||
| SidebarLink | ||
| SidebarTitle | ||
|
||
export const sidebarElements: SidebarElements[] = [ | ||
{ | ||
type: 'element', | ||
label: 'Home', | ||
href: '/', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Getting started', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Installation', | ||
href: '/documentation/installation', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'How is tuono different?', | ||
href: '/documentation/how-is-tuono-different', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Tutorial', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial', | ||
label: 'Intro', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/development-setup', | ||
label: 'Development setup', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/api-fetching', | ||
label: 'API fetching', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/components', | ||
label: 'Components', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/dynamic-routes', | ||
label: 'Dynamic routes', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/error-handling', | ||
label: 'Error handling', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/seo', | ||
label: 'SEO and meta tags', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/redirections', | ||
label: 'Redirections', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/production', | ||
label: 'Production build', | ||
}, | ||
{ | ||
type: 'element', | ||
href: '/documentation/tutorial/conclusion', | ||
label: 'Conclusion', | ||
}, | ||
], | ||
}, | ||
{ type: 'divider' }, | ||
{ type: 'title', label: 'Overview' }, | ||
{ | ||
type: 'element', | ||
label: 'Routing', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Defining routes', | ||
href: '/documentation/routing/defining-routes', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Pages', | ||
href: '/documentation/routing/pages', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Loading state', | ||
href: '/documentation/routing/loading-state', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Dynamic routes', | ||
href: '/documentation/routing/dynamic-routes', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Layouts', | ||
href: '/documentation/routing/layouts', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Link and navigation', | ||
href: '/documentation/routing/link-and-navigation', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Redirecting', | ||
href: '/documentation/routing/redirecting', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Rendering', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Server side rendering', | ||
href: '/documentation/rendering/server-side-rendering', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Static site rendering', | ||
href: '/documentation/rendering/static-site-rendering', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Styles', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'CSS modules', | ||
href: '/documentation/styles/css-modules', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Integrations', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'MDX', | ||
href: '/documentation/integrations/mdx', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Core concepts', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Multithreading', | ||
href: '/documentation/core-concepts/multithreading', | ||
}, | ||
], | ||
}, | ||
{ type: 'divider' }, | ||
{ type: 'title', label: 'API reference' }, | ||
{ | ||
type: 'element', | ||
label: 'Components', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Head', | ||
href: '/documentation/components/head', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Link', | ||
href: '/documentation/components/link', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Hooks', | ||
href: '#focus', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'useRouter', | ||
href: '/documentation/hooks/use-router', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'CLI', | ||
href: '/documentation/cli', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Application state', | ||
href: '/documentation/application-state', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'tuono.config.ts', | ||
href: '/documentation/configuration', | ||
}, | ||
|
||
{ type: 'divider' }, | ||
{ | ||
type: 'element', | ||
label: 'Contributing', | ||
href: '#focus', | ||
leftIcon: '✨', | ||
children: [ | ||
{ | ||
type: 'element', | ||
label: 'Guildelines', | ||
href: '/documentation/contributing', | ||
}, | ||
{ | ||
type: 'element', | ||
label: 'Local development', | ||
href: '/documentation/contributing/local-development', | ||
}, | ||
], | ||
}, | ||
] |
13 changes: 12 additions & 1 deletion
13
apps/documentation/src/components/sidebar/sidebar-link.module.css
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,6 +1,17 @@ | ||
.link { | ||
border-radius: 8px; | ||
margin-top: 0.25rem; | ||
line-height: 1.25rem; | ||
line-height: 1rem; | ||
font-weight: 500; | ||
transition: 0.3s; | ||
} | ||
|
||
.link span { | ||
font-size: 14px !important; | ||
color: var(--mantine-color-sidebar-gray); | ||
} | ||
|
||
.link:hover span, | ||
.active span { | ||
color: var(--mantine-color-sidebar-text-hover); | ||
} |
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
Oops, something went wrong.