Skip to content

Commit

Permalink
Merge pull request #14 from brook-code-theme/feature/docs
Browse files Browse the repository at this point in the history
Feature/docs
  • Loading branch information
nyomansunima authored Dec 19, 2024
2 parents 4baffe1 + c663286 commit 18b916b
Show file tree
Hide file tree
Showing 29 changed files with 858 additions and 73 deletions.
22 changes: 13 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@
## [v2.0.1](https://github.com/brook-code-theme/official-website/releases/tag/v2.0.1) - 2024-12-10 06:53:30

## What's Changed
* npm(deps): bump next from 15.0.3 to 15.0.4 by @dependabot in https://github.com/brook-code-theme/official-website/pull/10
* npm(deps-dev): bump eslint-config-next from 15.0.3 to 15.0.4 by @dependabot in https://github.com/brook-code-theme/official-website/pull/8
* npm(deps-dev): bump @types/node from 20.17.9 to 22.10.1 by @dependabot in https://github.com/brook-code-theme/official-website/pull/6
* npm(deps-dev): bump eslint from 8.57.1 to 9.16.0 by @dependabot in https://github.com/brook-code-theme/official-website/pull/7
* npm(deps): bump react-dom from 19.0.0-rc-66855b96-20241106 to 19.0.0 by @dependabot in https://github.com/brook-code-theme/official-website/pull/9

- npm(deps): bump next from 15.0.3 to 15.0.4 by @dependabot in https://github.com/brook-code-theme/official-website/pull/10
- npm(deps-dev): bump eslint-config-next from 15.0.3 to 15.0.4 by @dependabot in https://github.com/brook-code-theme/official-website/pull/8
- npm(deps-dev): bump @types/node from 20.17.9 to 22.10.1 by @dependabot in https://github.com/brook-code-theme/official-website/pull/6
- npm(deps-dev): bump eslint from 8.57.1 to 9.16.0 by @dependabot in https://github.com/brook-code-theme/official-website/pull/7
- npm(deps): bump react-dom from 19.0.0-rc-66855b96-20241106 to 19.0.0 by @dependabot in https://github.com/brook-code-theme/official-website/pull/9

## New Contributors
* @dependabot made their first contribution in https://github.com/brook-code-theme/official-website/pull/10

- @dependabot made their first contribution in https://github.com/brook-code-theme/official-website/pull/10

**Full Changelog**: https://github.com/brook-code-theme/official-website/compare/v2.0.0...v2.0.1

## [v2.0.0](https://github.com/brook-code-theme/official-website/releases/tag/v2.0.0) - 2024-11-29 13:37:07

## What's Changed
* Add multiple pages by @nyomansunima in https://github.com/brook-code-theme/official-website/pull/5

- Add multiple pages by @nyomansunima in https://github.com/brook-code-theme/official-website/pull/5

## New Contributors
* @nyomansunima made their first contribution in https://github.com/brook-code-theme/official-website/pull/5

- @nyomansunima made their first contribution in https://github.com/brook-code-theme/official-website/pull/5

**Full Changelog**: https://github.com/brook-code-theme/official-website/compare/v1.0.0...v2.0.0

## [v1.0.0](https://github.com/brook-code-theme/official-website/releases/tag/v1.0.0) - 2024-11-25 16:11:43

**Full Changelog**: https://github.com/brook-code-theme/official-website/commits/v1.0.0

\* *This CHANGELOG was automatically generated by [auto-generate-changelog](https://github.com/BobAnkh/auto-generate-changelog)*
\* _This CHANGELOG was automatically generated by [auto-generate-changelog](https://github.com/BobAnkh/auto-generate-changelog)_
Binary file modified bun.lockb
Binary file not shown.
35 changes: 19 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,38 @@
},
"dependencies": {
"@flaticon/flaticon-uicons": "^3.3.1",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-toast": "^1.2.2",
"@radix-ui/react-tooltip": "^1.1.4",
"@radix-ui/react-accordion": "^1.2.2",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-toast": "^1.2.4",
"@radix-ui/react-tooltip": "^1.1.6",
"dayjs": "^1.11.13",
"lenis": "^1.1.16",
"motion": "^11.13.3",
"next": "15.1.0",
"next-themes": "^0.4.3",
"posthog-js": "^1.188.0",
"lenis": "^1.1.18",
"motion": "^11.15.0",
"next": "15.1.1",
"next-mdx-remote-client": "^1.0.3",
"next-themes": "^0.4.4",
"posthog-js": "^1.202.2",
"react": "19.0.0",
"react-dom": "19.0.0"
"react-dom": "19.0.0",
"rehype-slug": "^6.0.0",
"remark-flexible-toc": "^1.1.1"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.9",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^22",
"@types/react": "^18",
"@types/react": "^19",
"@types/react-dom": "^19",
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.0",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"eslint": "^9",
"eslint-config-next": "15.1.0",
"eslint-config-next": "15.1.1",
"eslint-config-prettier": "^9.1.0",
"postcss": "^8.4.49",
"prettier": "^3.3.3",
"tailwind-merge": "^2.5.4",
"tailwindcss": "^3.4.15",
"prettier": "^3.4.2",
"tailwind-merge": "^2.5.5",
"tailwindcss": "^3.4.17",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5"
}
Expand Down
Binary file added src/app/apple-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/app/docs/[[...slug]]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { CenterContent, LeftContent, RightContent } from '@features/docs'
import * as React from 'react'

type Params = {
slug: string[] | undefined
}

type DocsLayoutProps = {
children: React.ReactNode
params: Promise<Params>
}

export default async function DocsLayout({
children,
params,
}: DocsLayoutProps): Promise<React.ReactElement> {
const { slug } = await params

return (
<main className="flex mt-28 min-h-screen relative">
<LeftContent />
<CenterContent slug={slug}>{children}</CenterContent>
<RightContent slug={slug} />
</main>
)
}
60 changes: 60 additions & 0 deletions src/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { DocsContent, getAllDocsPaths, getDocMetadata } from '@features/docs'
import { sharedMetadata } from '@shared/libs'
import { Metadata, ResolvingMetadata } from 'next'
import * as React from 'react'

type Params = {
slug: string[] | undefined
}

type DocsPageProps = {
params: Promise<Params>
}

export async function generateMetadata(
{ params }: DocsPageProps,
parent: ResolvingMetadata,
): Promise<Metadata> {
const { slug } = await params
const meta = await getDocMetadata(slug)
const previousOgImages = (await parent).openGraph?.images || []
const previousTwitterImages = (await parent).twitter?.images || []

return {
title: meta.title,
description: meta.description,
openGraph: {
...sharedMetadata.openGraph,
title: meta.title,
description: meta.description,
images: [...previousOgImages],
},
twitter: {
...sharedMetadata.twitter,
title: meta.title,
description: meta.description,
images: [...previousTwitterImages],
},
}
}

export async function generateStaticParams(): Promise<Params[]> {
const paths = await getAllDocsPaths()
const staticParams = paths.map((path) => ({
slug: [path],
}))

return staticParams
}

export default async function DocsPage({
params,
}: DocsPageProps): Promise<React.ReactElement> {
const { slug } = await params

return (
<div className="flex flex-col">
<DocsContent slug={slug} />
</div>
)
}
31 changes: 0 additions & 31 deletions src/app/docs/page.tsx

This file was deleted.

11 changes: 6 additions & 5 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ export default function RootLayout({
children,
}: Readonly<RootLayoutProps>): React.ReactElement {
return (
<html lang="en" suppressHydrationWarning>
<html
lang="en"
suppressHydrationWarning
className={`${fonts.geistSans.variable} ${fonts.geistMono.variable}`}
>
<PosthogProvider>
<AnimationProvider>
<body
className={`${fonts.geistSans.variable} ${fonts.geistMono.variable}`}
suppressHydrationWarning
>
<body suppressHydrationWarning>
<ThemeProvider
enableSystem
attribute={'class'}
Expand Down
2 changes: 1 addition & 1 deletion src/features/changelog/changelog-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function ChangelogSection(): React.ReactElement {
<div className="flex flex-col items-center mx-auto w-full">
<SectionLabel>What’s new</SectionLabel>

<h2 className="text-3xl tablet:text-5xl text-foreground font-medium !leading-tight text-balance text-center mt-8 tablet:w-7/12">
<h2 className="text-xl text-foreground font-medium !leading-tight text-balance text-center mt-8 tablet:w-7/12">
Changelog
</h2>

Expand Down
33 changes: 33 additions & 0 deletions src/features/docs/breadcrumb.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import Link from 'next/link'
import * as React from 'react'
import { getBreadcrumb } from './docs-service'

type BreadcrumbProps = {
slug: string[] | undefined
}

export async function Breadcrumb({
slug,
}: BreadcrumbProps): Promise<React.ReactElement> {
const { title, link } = await getBreadcrumb(slug)

return (
<div className="flex items-center w-full text-sm text-foreground/60 gap-1">
<Link
href={'/docs'}
className="transition-all duration-300 hover:text-foreground"
>
Docs
</Link>

<i className="fi fi-rr-angle-small-right" />

<Link
href={link}
className="transition-all duration-300 hover:text-foreground"
>
{title}
</Link>
</div>
)
}
21 changes: 21 additions & 0 deletions src/features/docs/center-content.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as React from 'react'
import { Breadcrumb } from './breadcrumb'

type CenterContentProps = {
children: React.ReactNode
slug: string[] | undefined
}

export function CenterContent({
children,
slug,
}: CenterContentProps): React.ReactElement {
return (
<div className="flex container mx-auto">
<div className="flex flex-col w-9/12 mx-auto gap-6 pb-28 tablet:pb-36">
<Breadcrumb slug={slug} />
<div className="flex w-full">{children}</div>
</div>
</div>
)
}
56 changes: 56 additions & 0 deletions src/features/docs/content/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Configuration
description: Customize Brook Code Theme to suit your coding style
publishedAt: 2024-12-19
---

Brook code theme is highly configurable, allowing you to customize the theme to your liking. Here's a quick guide to get you started.

## Configuration Options

Brook Code Theme offers a wide range of customization options to suit your coding style and preferences. Here's a list of the most commonly used options:

### Color Scheme

The color scheme determines the overall look and feel of the theme. You can choose between a light or dark theme, or even create your own custom color scheme. The default color scheme is a soft pastel theme that provides a calming and relaxing atmosphere.

### Syntax Highlighting

The syntax highlighting option allows you to choose the programming language you want to highlight. You can choose from a variety of languages, including JavaScript, TypeScript, Python, Go, Rust, HTML, and CSS. The default syntax highlighting is set to JavaScript.

### Theme Variant

The theme variant option allows you to choose between two different color schemes. The default variant is a subtle pastel theme that provides a soft and calming look. You can also choose a more vibrant and energetic variant, which is perfect for coding in a fast-paced environment.

### Editor Font

The editor font option allows you to choose the font you want to use in your code editor. You can choose from a variety of fonts, including monospace, sans-serif, and serif. The default font is a monospace font that provides a clean and professional look.

### Editor Font Size

The editor font size option allows you to adjust the size of the font in your code editor. You can choose from a range of font sizes, including small, medium, and large. The default font size is set to medium.

### Editor Font Weight

The editor font weight option allows you to choose the weight of the font in your code editor. You can choose from a range of font weights, including light, regular, and bold. The default font weight is set to regular.

### Editor Font Family

The editor font family option allows you to choose the font family of the font in your code editor. You can choose from a variety of font families, including monospace, sans-serif, and serif. The default font family is set to monospace.

### Editor Font Style

The editor font style option allows you to choose the style of the font in your code editor. You can choose from a variety of font styles, including normal, italic, and oblique. The default font style is set to normal.

## Customizing the Theme

Brook Code Theme is highly customizable, allowing you to tailor the theme to your liking. You can change the color scheme, syntax highlighting, theme variant, editor font, font size, font weight, font family, and font style. Here's how to customize the theme:

1. Open the Brook Code Theme settings in your code editor.
2. Navigate to the **Theme** section in the settings menu.
3. Choose the color scheme, syntax highlighting, theme variant, editor font, font size, font weight, font family, and font style that you want to use.
4. Save the changes and enjoy the customized theme!

## Enjoy the Theme

With the Brook Code Theme, you can customize the theme to your liking and create a unique coding experience. Happy coding! 🎨✨
34 changes: 34 additions & 0 deletions src/features/docs/content/installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Installation
description: How to install Brook Code Theme
publishedAt: 2024-12-19
---

Follow these steps to set up the Brook Code Theme in your favorite editor. This guide includes detailed instructions for Zed Editor and Visual Studio Code.

## Zed Editor

1. Open **Zed Editor**.
2. Navigate to the top-right corner and click on **Settings** (`Ctrl+,` or `Cmd+,`).
3. Select the **Themes** section in the settings menu.
4. Click on **Marketplace** and search for `Brook Code Theme`.
5. Click **Install** next to the Brook Code Theme.
6. Once installed, activate the theme.

Congratulations! Your Zed Editor is now set up with the **Brook Code Theme**.

## VSCode

1. Open **Visual Studio Code**.
2. Go to the **Extensions View**:
- Click on the Extensions icon in the Activity Bar.
- Or press `Ctrl+Shift+X` (Windows/Linux) or `Cmd+Shift+X` (macOS).
3. In the search bar, type:
4. Select the **Brook Code Theme** from the search results.
5. Click the **Install** button.

Your VSCode is now ready to use with the **Brook Code Theme**!

## Enjoy the Theme

Both **Zed Editor** and **VSCode** now have the vibrant and accessible **Brook Code Theme** installed. Happy coding! 🎨✨
Loading

0 comments on commit 18b916b

Please sign in to comment.