Skip to content

Commit

Permalink
test: add docusaurus website
Browse files Browse the repository at this point in the history
  • Loading branch information
notunderctrl committed Dec 16, 2024
1 parent 1ac2f35 commit 5cead41
Show file tree
Hide file tree
Showing 17 changed files with 14,504 additions and 5,555 deletions.
20 changes: 20 additions & 0 deletions apps/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
5 changes: 5 additions & 0 deletions apps/website/docs/api-reference/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 1
---

# API reference intro
5 changes: 5 additions & 0 deletions apps/website/docs/guide/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
sidebar_position: 1
---

# Guide intro
80 changes: 80 additions & 0 deletions apps/website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'CommandKit',
tagline: 'A Discord.js handler',
favicon: 'img/favicon.ico',
url: 'https://commandkit.dev',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
editUrl:
'https://github.com/underctrl-io/commandkit/tree/main/apps/website/',
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'CommandKit',
logo: {
alt: 'CommandKit logo',
src: 'img/logo_128.png',
},
items: [
{
type: 'docSidebar',
sidebarId: 'guide',
position: 'left',
label: 'Guide',
},
{
type: 'docSidebar',
sidebarId: 'api',
position: 'left',
label: 'API Reference',
},
{
type: 'docsVersionDropdown',
position: 'right',
},
{
href: 'https://github.com/underctrl-io/commandkit',
label: 'GitHub',
position: 'right',
},
{
href: 'https://ctrl.lol/discord',
label: 'Discord',
position: 'right',
},
],
},
footer: {
style: 'light',
copyright: `Copyright © ${new Date().getFullYear()} CommandKit`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
47 changes: 47 additions & 0 deletions apps/website/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "website",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.6.3",
"@docusaurus/preset-classic": "3.6.3",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.6.3",
"@docusaurus/tsconfig": "3.6.3",
"@docusaurus/types": "3.6.3",
"typescript": "~5.6.2"
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all"
],
"development": [
"last 3 chrome version",
"last 3 firefox version",
"last 5 safari version"
]
},
"engines": {
"node": ">=18.0"
}
}
18 changes: 18 additions & 0 deletions apps/website/sidebars.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

const sidebars: SidebarsConfig = {
guide: [
{
type: 'autogenerated',
dirName: 'guide',
},
],
api: [
{
type: 'autogenerated',
dirName: 'api-reference',
},
],
};

export default sidebars;
30 changes: 30 additions & 0 deletions apps/website/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* Any CSS included here will be global. The classic template
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/

/* You can override the default Infima variables here. */
:root {
--ifm-color-primary: #2e8555;
--ifm-color-primary-dark: #29784c;
--ifm-color-primary-darker: #277148;
--ifm-color-primary-darkest: #205d3b;
--ifm-color-primary-light: #33925d;
--ifm-color-primary-lighter: #359962;
--ifm-color-primary-lightest: #3cad6e;
--ifm-code-font-size: 95%;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
}

/* For readability concerns, you should choose a lighter palette in dark mode. */
[data-theme='dark'] {
--ifm-color-primary: #25c2a0;
--ifm-color-primary-dark: #21af90;
--ifm-color-primary-darker: #1fa588;
--ifm-color-primary-darkest: #1a8870;
--ifm-color-primary-light: #29d5b0;
--ifm-color-primary-lighter: #32d8b4;
--ifm-color-primary-lightest: #4fddbf;
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
}
11 changes: 11 additions & 0 deletions apps/website/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Layout from '@theme/Layout';

export default function Home(): React.JSX.Element {
return (
<Layout>
<main>
<div>Home page</div>
</main>
</Layout>
);
}
Binary file added apps/website/static/img/ckit_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions apps/website/static/img/ckit_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/website/static/img/counter.mp4
Binary file not shown.
Binary file added apps/website/static/img/favicon.ico
Binary file not shown.
Binary file added apps/website/static/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/website/static/img/logo.webp
Binary file not shown.
Binary file added apps/website/static/img/logo_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions apps/website/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
},
"exclude": [".docusaurus", "build"]
}
Loading

0 comments on commit 5cead41

Please sign in to comment.