diff --git a/cli/README.md b/cli/README.md index ebfbdfa..177f837 100644 --- a/cli/README.md +++ b/cli/README.md @@ -55,7 +55,7 @@ npx create-cardinal-app@latest ## Docs -You can find detailed information about the available tech stacks, recommendations on how to choose and use your stack, and addtional resources about the included tools [in the docs](https://cardinal.ernestoresende.com/docs/en/introduction). +You can find detailed information about the available tech stacks, recommendations on how to choose and use your stack, and addtional resources about the included tools [in the docs](https://cardinal.ernestoresende.com/docs/introduction). ## Contribution diff --git a/cli/package.json b/cli/package.json index dedbc4e..b4f8302 100644 --- a/cli/package.json +++ b/cli/package.json @@ -27,7 +27,7 @@ "dependencyMap:update": "esrun ./src/helpers/updateDependencyMap.ts", "dp:update": "esrun ./src/helpers/updateDependencyMap.ts", "dev": "tsup --watch --env.PACKAGE_MANAGER_OVERRIDE=pnpm --env.NODE_ENV=development", - "format": "pnpm prettier --parser=babel-ts --check \"src/**/*.{ts,tsx,js,jsx}\" --ignore-unknown", + "format": "pnpm prettier --plugin-search-dir=. --check \"src/**/*.{ts,tsx,js,jsx}\" --ignore-unknown", "format:write": "pnpm format -w", "lint": "pnpm eslint . -c .eslintrc.cjs", "lint:fix": "pnpm lint --fix", @@ -47,10 +47,10 @@ "devDependencies": { "@digitak/esrun": "^3.2.24", "@ianvs/prettier-plugin-sort-imports": "^4.0.2", - "@types/eslint": "^8.40.1", + "@types/eslint": "^8.40.2", "@types/fs-extra": "^11.0.1", "@types/js-yaml": "^4.0.5", - "@types/node": "^20.3.0", + "@types/node": "^20.3.1", "@typescript-eslint/eslint-plugin": "^5.59.11", "@typescript-eslint/parser": "^5.59.11", "eslint": "^8.42.0", diff --git a/cli/prettier.config.cjs b/cli/prettier.config.cjs index bf0f49c..1e1d861 100644 --- a/cli/prettier.config.cjs +++ b/cli/prettier.config.cjs @@ -3,7 +3,24 @@ const baseConfig = require("../prettier.config.cjs"); /** @type {import('prettier').Config} */ const config = { ...baseConfig, - plugins: [...baseConfig.plugins], + importOrderSeparation: false, + importOrderSortSpecifiers: true, + importOrderBuiltinModulesToTop: true, + importOrderParserPlugins: ["typescript", "decorators-legacy"], + importOrderMergeDuplicateImports: true, + importOrderCombineTypeAndValueImports: true, + importOrder: [ + "", + "", + "^types$", + "^@/(.*)$", + "^@/helpers(.*)$", + "^@/installers/(.*)$", + "^@/utils/(.*)$", + "", + "^[./]", + ], + plugins: [require("@ianvs/prettier-plugin-sort-imports")], }; module.exports = config; diff --git a/cli/src/index.ts b/cli/src/index.ts index 5070a5e..1dcbfa7 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -55,7 +55,7 @@ async function main() { process.stdout.write( `${color.dim( - "Need help choosing your stack? Head to https://cardinal.ernestoresende.com/docs/en/recommendations", + "Need help choosing your stack? Head to https://cardinal.ernestoresende.com/docs/recommendations", )}\n \n`, ); diff --git a/package.json b/package.json index abe7fed..b23b2fa 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "dependencies": { "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.1", - "@ianvs/prettier-plugin-sort-imports": "^4.0.2", "@types/node": "^20.2.5", "@types/prettier": "^2.7.3", "eslint-config-prettier": "^8.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 971bf4a..81d95e4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,9 +10,6 @@ importers: '@changesets/cli': specifier: ^2.26.1 version: 2.26.1 - '@ianvs/prettier-plugin-sort-imports': - specifier: ^4.0.2 - version: 4.0.2(prettier@2.8.8) '@types/node': specifier: ^20.2.5 version: 20.2.5 @@ -69,8 +66,8 @@ importers: specifier: ^4.0.2 version: 4.0.2(prettier@2.8.8) '@types/eslint': - specifier: ^8.40.1 - version: 8.40.1 + specifier: ^8.40.2 + version: 8.40.2 '@types/fs-extra': specifier: ^11.0.1 version: 11.0.1 @@ -78,8 +75,8 @@ importers: specifier: ^4.0.5 version: 4.0.5 '@types/node': - specifier: ^20.3.0 - version: 20.3.0 + specifier: ^20.3.1 + version: 20.3.1 '@typescript-eslint/eslint-plugin': specifier: ^5.59.11 version: 5.59.11(@typescript-eslint/parser@5.59.11)(eslint@8.42.0)(typescript@5.1.3) @@ -168,6 +165,9 @@ importers: specifier: ^1.0.5 version: 1.0.5(tailwindcss@3.3.2) devDependencies: + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.0.2 + version: 4.0.2(prettier@2.8.8) '@types/html-escaper': specifier: ^3.0.0 version: 3.0.0 @@ -1241,6 +1241,7 @@ packages: semver: 7.5.1 transitivePeerDependencies: - supports-color + dev: true /@isaacs/cliui@8.0.2: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} @@ -1956,8 +1957,8 @@ packages: '@types/ms': 0.7.31 dev: false - /@types/eslint@8.40.1: - resolution: {integrity: sha512-vRb792M4mF1FBT+eoLecmkpLXwxsBHvWWRGJjzbYANBM6DtiJc6yETyv4rqDA6QNjF1pkj1U7LMA6dGb3VYlHw==} + /@types/eslint@8.40.2: + resolution: {integrity: sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==} dependencies: '@types/estree': 1.0.1 '@types/json-schema': 7.0.12 @@ -1976,7 +1977,7 @@ packages: resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} dependencies: '@types/jsonfile': 6.1.1 - '@types/node': 20.3.0 + '@types/node': 20.3.1 dev: true /@types/hast@2.3.4: @@ -2018,7 +2019,7 @@ packages: /@types/jsonfile@6.1.1: resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==} dependencies: - '@types/node': 20.3.0 + '@types/node': 20.3.1 dev: true /@types/mdast@3.0.11: @@ -2052,8 +2053,8 @@ packages: /@types/node@20.2.5: resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} - /@types/node@20.3.0: - resolution: {integrity: sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==} + /@types/node@20.3.1: + resolution: {integrity: sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==} dev: true /@types/normalize-package-data@2.4.1: diff --git a/prettier.config.cjs b/prettier.config.cjs index 634c8cc..66ad014 100644 --- a/prettier.config.cjs +++ b/prettier.config.cjs @@ -6,22 +6,4 @@ module.exports = { semi: true, trailingComma: "all", tabWidth: 2, - importOrderSeparation: false, - importOrderSortSpecifiers: true, - importOrderBuiltinModulesToTop: true, - importOrderParserPlugins: ["typescript", "decorators-legacy"], - importOrderMergeDuplicateImports: true, - importOrderCombineTypeAndValueImports: true, - importOrder: [ - "", - "", - "^types$", - "^@/(.*)$", - "^@/helpers(.*)$", - "^@/installers/(.*)$", - "^@/utils/(.*)$", - "", - "^[./]", - ], - plugins: [require("@ianvs/prettier-plugin-sort-imports")], }; diff --git a/www/.prettierrc.cjs b/www/.prettierrc.cjs deleted file mode 100644 index 6d26700..0000000 --- a/www/.prettierrc.cjs +++ /dev/null @@ -1,15 +0,0 @@ -/** @type {import('prettier').Config} */ -module.exports = { - arrowParens: "always", - printWidth: 120, - singleQuote: false, - jsxSingleQuote: false, - semi: true, - trailingComma: "all", - tabWidth: 2, - plugins: [ - require.resolve('prettier-plugin-astro'), - require.resolve('prettier-plugin-tailwindcss') - ], - tailwindConfig: './tailwind.config.cjs', -} diff --git a/www/README.md b/www/README.md index 1ba63a9..e69de29 100644 --- a/www/README.md +++ b/www/README.md @@ -1,175 +0,0 @@ -# Astro Starter Kit: Docs Site - -```bash -npm create astro@latest -- --template docs -``` - -[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/docs) -[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/docs) - -> πŸ§‘β€πŸš€ **Seasoned astronaut?** Delete this file. Have fun! - -![docs](https://user-images.githubusercontent.com/4677417/186189283-0831b9ab-d6b9-485d-8955-3057e532ab31.png) - -## Features - -- βœ… **Full Markdown support** -- βœ… **Responsive mobile-friendly design** -- βœ… **Sidebar navigation** -- βœ… **Search (powered by Algolia)** -- βœ… **Multi-language i18n** -- βœ… **Automatic table of contents** -- βœ… **Automatic list of contributors** -- βœ… (and, best of all) **dark mode** - -## 🧞 Commands - -All commands are run from the root of the project, from a terminal: - -| Command | Action | -| :--------------------- | :----------------------------------------------- | -| `npm install` | Installs dependencies | -| `npm run dev` | Starts local dev server at `localhost:3000` | -| `npm run build` | Build your production site to `./dist/` | -| `npm run preview` | Preview your build locally, before deploying | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | -| `npm run astro --help` | Get help using the Astro CLI | - -To deploy your site to production, check out our [Deploy an Astro Website](https://docs.astro.build/guides/deploy) guide. - -## πŸ‘€ Want to learn more? - -Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). - -## Customize This Theme - -### Site metadata - -`src/config.ts` contains several data objects that describe metadata about your site like title, description, default language, and Open Graph details. You can customize these to match your project. - -### CSS styling - -The theme's look and feel is controlled by a few key variables that you can customize yourself. You'll find them in the `src/styles/theme.css` CSS file. - -If you've never worked with CSS variables before, give [MDN's guide on CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) a quick read. - -This theme uses a "cool blue" accent color by default. To customize this for your project, change the `--theme-accent` variable to whatever color you'd like: - -```diff -/* src/styles/theme.css */ -:root { - color-scheme: light; -- --theme-accent: hsla(var(--color-blue), 1); -+ --theme-accent: hsla(var(--color-red), 1); /* or: hsla(#FF0000, 1); */ -``` - -## Page metadata - -Astro uses frontmatter in Markdown pages to choose layouts and pass properties to those layouts. If you are using the default layout, you can customize the page in many different ways to optimize SEO and other things. For example, you can use the `title` and `description` properties to set the document title, meta title, meta description, and Open Graph description. - -```markdown ---- -title: Example title -description: Really cool docs example that uses Astro -layout: ../../layouts/MainLayout.astro ---- - -# Page content... -``` - -For more SEO related properties, look at `src/components/HeadSEO.astro` - -### Sidebar navigation - -The sidebar navigation is controlled by the `SIDEBAR` variable in your `src/config.ts` file. You can customize the sidebar by modifying this object. A default, starter navigation has already been created for you. - -```ts -export const SIDEBAR = { - en: [ - { text: "Section Header", header: true }, - { text: "Introduction", link: "en/introduction" }, - { text: "Page 2", link: "en/page-2" }, - { text: "Page 3", link: "en/page-3" }, - - { text: "Another Section", header: true }, - { text: "Page 4", link: "en/page-4" }, - ], -}; -``` - -Note the top-level `en` key: This is needed for multi-language support. You can change it to whatever language you'd like, or add new languages as you go. More details on this below. - -### Multiple Languages support - -The Astro docs template supports multiple languages out of the box. The default theme only shows `en` documentation, but you can enable multi-language support features by adding a second language to your project. - -To add a new language to your project, you'll want to extend the current `src/content/docs/[lang]/...` layout: - -```diff - πŸ“‚ src/content/docs - ┣ πŸ“‚ en - ┃ ┣ πŸ“œ page-1.md - ┃ ┣ πŸ“œ page-2.md - ┃ ┣ πŸ“œ page-3.astro -+ ┣ πŸ“‚ es -+ ┃ ┣ πŸ“œ page-1.md -+ ┃ ┣ πŸ“œ page-2.md -+ ┃ ┣ πŸ“œ page-3.astro -``` - -You'll also need to add the new language name to the `KNOWN_LANGUAGES` map in your `src/config.ts` file. This will enable your new language switcher in the site header. - -```diff -// src/config.ts -export const KNOWN_LANGUAGES = { - English: 'en', -+ Spanish: 'es', -}; -``` - -Last step: you'll need to add a new entry to your sidebar, to create the table of contents for that language. While duplicating every page might not sound ideal to everyone, this extra control allows you to create entirely custom content for every language. - -> Make sure the sidebar `link` value points to the correct language! - -```diff -// src/config.ts -export const SIDEBAR = { - en: [ - { text: 'Section Header', header: true, }, - { text: 'Introduction', link: 'en/introduction' }, - // ... - ], -+ es: [ -+ { text: 'Encabezado de secciΓ³n', header: true, }, -+ { text: 'IntroducciΓ³n', link: 'es/introduction' }, -+ // ... -+ ], -}; - -// ... -``` - -If you plan to use Spanish as the default language, you just need to modify the redirect path in `src/pages/index.astro`: - -```diff - -``` - -You can also remove the above script and write a landing page in Spanish instead. - -### What if I don't plan to support multiple languages? - -That's totally fine! Not all projects need (or can support) multiple languages. You can continue to use this theme without ever adding a second language. - -If that single language is not English, you can just replace `en` in directory layouts and configurations with the preferred language. - -### Search (Powered by Algolia) - -[Algolia](https://www.algolia.com/) offers a free service to qualified open source projects called [DocSearch](https://docsearch.algolia.com/). If you are accepted to the DocSearch program, provide your API Key & index name in `src/config.ts` and a search box will automatically appear in your site header. - -Note that Aglolia and Astro are not affiliated. We have no say over acceptance to the DocSearch program. - -If you'd prefer to remove Algolia's search and replace it with your own, check out the `src/components/Header.astro` component to see where the component is added. diff --git a/www/algolia/config.json b/www/algolia/config.json index 40ad7a3..3b1c333 100644 --- a/www/algolia/config.json +++ b/www/algolia/config.json @@ -1,6 +1,6 @@ { "index_name": "cardinal-docs", - "start_urls": ["https://cardinal.ernestoresende.com/docs/en/introduction"], + "start_urls": ["https://cardinal.ernestoresende.com/docs/introduction"], "stop_urls": [], "selectors": { "lvl0": { "selector": "[data-algolia-lvl0]", "global": true }, diff --git a/www/astro.config.mjs b/www/astro.config.mjs index c1500e9..8b782c6 100644 --- a/www/astro.config.mjs +++ b/www/astro.config.mjs @@ -1,8 +1,8 @@ -import { defineConfig } from "astro/config"; -import react from "@astrojs/react"; -import tailwind from "@astrojs/tailwind"; import image from "@astrojs/image"; import mdx from "@astrojs/mdx"; +import react from "@astrojs/react"; +import tailwind from "@astrojs/tailwind"; +import { defineConfig } from "astro/config"; // https://astro.build/config export default defineConfig({ diff --git a/www/package.json b/www/package.json index 32a990a..ef24aeb 100644 --- a/www/package.json +++ b/www/package.json @@ -9,7 +9,8 @@ "astro": "astro", "build": "astro build", "dev": "astro dev", - "format": "prettier --write \"**/*.{astro,html,js,jsx,md,mdx,ts,tsx}\"", + "format": "prettier --check --plugin-search-dir=. **/*.{cjs,mjs,ts,tsx,md,json,astro} --ignore-path ../.gitignore --ignore-unknown --no-error-on-unmatched-pattern", + "format:write": "pnpm format --write", "preview": "astro preview", "start": "astro dev" }, @@ -32,6 +33,7 @@ "tailwindcss-animate": "^1.0.5" }, "devDependencies": { + "@ianvs/prettier-plugin-sort-imports": "^4.0.2", "@types/html-escaper": "^3.0.0", "@types/node": "^20.2.5", "@types/react": "^18.2.8", diff --git a/www/postcss.config.cjs b/www/postcss.config.cjs index 565f70c..6887c82 100644 --- a/www/postcss.config.cjs +++ b/www/postcss.config.cjs @@ -1,8 +1,8 @@ module.exports = { plugins: { - 'postcss-import': {}, - 'tailwindcss/nesting': {}, + "postcss-import": {}, + "tailwindcss/nesting": {}, tailwindcss: {}, autoprefixer: {}, - } -} + }, +}; diff --git a/www/prettier.config.cjs b/www/prettier.config.cjs new file mode 100644 index 0000000..05b9490 --- /dev/null +++ b/www/prettier.config.cjs @@ -0,0 +1,36 @@ +const baseConfig = require("../prettier.config.cjs"); + +/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */ +module.exports = { + ...baseConfig, + plugins: [ + require.resolve("prettier-plugin-astro"), + require.resolve("prettier-plugin-tailwindcss"), // MUST come last + require.resolve("@ianvs/prettier-plugin-sort-imports"), + ], + pluginSearchDirs: false, + importOrderSeparation: true, + importOrderSortSpecifiers: true, + importOrderBuiltinModulesToTop: true, + importOrderParserPlugins: ["typescript", "jsx"], + importOrder: [ + "", + "", + "^types$", + "^@/(.*)$", + "^@/components/(.*)$", + "^@/content/(.*)$", + "^@/utils/(.*)$", + "", + "^[./]", + ], + overrides: [ + { + files: "*.astro", + options: { + parser: "astro", + }, + }, + ], + tailwindConfig: "./tailwind.config.cjs", +}; diff --git a/www/public/fonts/CircularBlack.woff2 b/www/public/fonts/CircularBlack.woff2 new file mode 100644 index 0000000..c47d475 Binary files /dev/null and b/www/public/fonts/CircularBlack.woff2 differ diff --git a/www/public/fonts/CircularBold.woff2 b/www/public/fonts/CircularBold.woff2 new file mode 100644 index 0000000..669f6dc Binary files /dev/null and b/www/public/fonts/CircularBold.woff2 differ diff --git a/www/public/fonts/CircularBook.woff2 b/www/public/fonts/CircularBook.woff2 new file mode 100644 index 0000000..d1374a3 Binary files /dev/null and b/www/public/fonts/CircularBook.woff2 differ diff --git a/www/public/fonts/CircularMedium.woff2 b/www/public/fonts/CircularMedium.woff2 new file mode 100644 index 0000000..778739c Binary files /dev/null and b/www/public/fonts/CircularMedium.woff2 differ diff --git a/www/public/fonts/OfficeCode.woff2 b/www/public/fonts/OfficeCode.woff2 new file mode 100644 index 0000000..f06d03c Binary files /dev/null and b/www/public/fonts/OfficeCode.woff2 differ diff --git a/www/src/assets/brand/CardinalLogo.astro b/www/src/assets/brand/CardinalLogo.astro index 6594ff9..e5b2dd2 100644 --- a/www/src/assets/brand/CardinalLogo.astro +++ b/www/src/assets/brand/CardinalLogo.astro @@ -8,34 +8,63 @@ type Props = { const { class: className } = Astro.props; --- - + - + - - - - + + + + - - - - + + + + - - - + + + diff --git a/www/src/assets/brand/ErOss.astro b/www/src/assets/brand/ErOss.astro index 00eb926..62fc6e6 100644 --- a/www/src/assets/brand/ErOss.astro +++ b/www/src/assets/brand/ErOss.astro @@ -9,7 +9,12 @@ type Props = { const { homepage, class: className } = Astro.props; --- - + - - - - - - - - - - - diff --git a/www/src/components/docs/mdx/components.tsx b/www/src/components/docs/mdx/components.tsx index c0c68be..d71ff88 100644 --- a/www/src/components/docs/mdx/components.tsx +++ b/www/src/components/docs/mdx/components.tsx @@ -1,4 +1,5 @@ import { LinkHeading } from "@/components/docs/mdx/link-heading"; + import "@/components/docs/mdx/mdx.css"; /** @@ -7,7 +8,10 @@ import "@/components/docs/mdx/mdx.css"; */ const components = { a: ({ children, ...props }: { children: any }) => ( - + {children} ), @@ -20,7 +24,10 @@ const components = { ), h2: ({ children, id, ...props }: { children: any; id: string }) => ( - +

{children}

diff --git a/www/src/components/docs/mdx/deep-dive.tsx b/www/src/components/docs/mdx/deep-dive.tsx index a097c59..e1dfaec 100644 --- a/www/src/components/docs/mdx/deep-dive.tsx +++ b/www/src/components/docs/mdx/deep-dive.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import { BookOpen, ChevronDown, ChevronUp } from "lucide-react"; +import * as React from "react"; const DeepDive: React.FC<{ title: string; @@ -8,11 +8,21 @@ const DeepDive: React.FC<{ const [open, setOpen] = React.useState(false); return ( -
+
- -
Deep dive
+ +
+ Deep dive +

{title}

diff --git a/www/src/components/docs/mdx/detail.tsx b/www/src/components/docs/mdx/detail.tsx index e4a9a10..e4d9dc9 100644 --- a/www/src/components/docs/mdx/detail.tsx +++ b/www/src/components/docs/mdx/detail.tsx @@ -1,5 +1,5 @@ -import { File, AlertTriangle } from "lucide-react"; import { clsx } from "clsx"; +import { AlertTriangle, File } from "lucide-react"; const Detail: React.FC<{ type: "note" | "warning"; @@ -9,7 +9,7 @@ const Detail: React.FC<{
-

Note

+

+ Note +

)} {type === "warning" && (
- -

Warning

+ +

+ Warning +

)}

{children}

diff --git a/www/src/components/docs/mdx/link-heading.tsx b/www/src/components/docs/mdx/link-heading.tsx index 28f942a..47297da 100644 --- a/www/src/components/docs/mdx/link-heading.tsx +++ b/www/src/components/docs/mdx/link-heading.tsx @@ -7,7 +7,10 @@ export const LinkHeading: React.FC<{ }> = ({ id, className, children }) => { return (
- + {children} diff --git a/www/src/components/docs/onThisPage.tsx b/www/src/components/docs/onThisPage.tsx index 1d60bdc..1eca1de 100644 --- a/www/src/components/docs/onThisPage.tsx +++ b/www/src/components/docs/onThisPage.tsx @@ -1,11 +1,17 @@ import type { MarkdownHeading } from "astro"; -import { useState, useEffect } from "react"; import { ChevronsUpDown } from "lucide-react"; +import { useEffect, useState } from "react"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/docs/collapsible"; import TableOfContents from "@/components/docs/tableOfContents"; -import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/docs/collapsible"; -export const OnThisPage: React.FC<{ headings: MarkdownHeading[] }> = ({ headings }) => { +export const OnThisPage: React.FC<{ + headings: MarkdownHeading[]; +}> = ({ headings }) => { const [isOpen, setIsOpen] = useState(false); const [mounted, setMounted] = useState(false); useEffect(() => { @@ -17,26 +23,36 @@ export const OnThisPage: React.FC<{ headings: MarkdownHeading[] }> = ({ headings if (!mounted) return ( - ); return ( - - - - - -
- -
-
-
+ <> + + + + + +
+ +
+
+
+ ); }; diff --git a/www/src/components/docs/pageContent.astro b/www/src/components/docs/pageContent.astro index b06c9a9..ee30acf 100644 --- a/www/src/components/docs/pageContent.astro +++ b/www/src/components/docs/pageContent.astro @@ -1,6 +1,7 @@ --- import type { MarkdownHeading } from "astro"; -import OnThisPage from "@/components/docs/onThisPage";; + +import OnThisPage from "@/components/docs/onThisPage"; import Pagination from "@/components/docs/pagination.astro"; import TableOfContents from "@/components/docs/tableOfContents"; @@ -14,22 +15,37 @@ type Props = { const { title, description, githubEditUrl, headings } = Astro.props; --- -
-
-