|
1 | | -# Starlight Starter Kit: Tailwind |
| 1 | +# <picture style="float:left; margin-right: 8px;"><source media="(prefers-color-scheme: dark)" srcset="./src/assets/aptos-logomark-dark.svg"><img src="./src/assets/aptos-logomark-light.svg" alt="Aptos logo" width="40" height="40"></picture> Aptos Docs |
2 | 2 |
|
3 | | -[](https://starlight.astro.build) |
| 3 | +This repository contains the source code for the official Aptos Developer Documentation, built using [Astro](https://astro.build/) and [Starlight](https://starlight.astro.build/). |
4 | 4 |
|
| 5 | +## Quick Start |
| 6 | + |
| 7 | +```bash |
| 8 | +# Clone the repository |
| 9 | +git clone https://github.com/aptos-labs/aptos-docs.git |
| 10 | +cd aptos-docs |
| 11 | + |
| 12 | +# Install dependencies |
| 13 | +pnpm install |
| 14 | + |
| 15 | +# Set up environment variables |
| 16 | +cp .env.example .env |
| 17 | + |
| 18 | +# Start the development server |
| 19 | +pnpm dev |
5 | 20 | ``` |
6 | | -npm create astro@latest -- --template starlight/tailwind |
| 21 | + |
| 22 | +Visit `http://localhost:4321` to see the documentation running locally. |
| 23 | + |
| 24 | +## Editing Documentation |
| 25 | + |
| 26 | +The main documentation content is located in the `src/content/docs/` directory: |
| 27 | + |
| 28 | +- Content is organized in directories that match the URL structure |
| 29 | +- Files are written in Markdown MDX (`.mdx`) format |
| 30 | +- Each file begins with frontmatter (metadata between `---` delimiters) |
| 31 | + |
| 32 | +Example frontmatter: |
| 33 | + |
| 34 | +```yaml |
| 35 | +--- |
| 36 | +title: Your Page Title |
| 37 | +description: A brief description of the page content |
| 38 | +--- |
7 | 39 | ``` |
8 | 40 |
|
9 | | -[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/tailwind) |
10 | | -[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/tailwind) |
11 | | -[](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/tailwind) |
12 | | -[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Ftailwind&project-name=my-starlight-docs&repository-name=my-starlight-docs) |
| 41 | +For more resources on authoring content within this environment, see: |
| 42 | + |
| 43 | +- [Authoring Content in Markdown](https://starlight.astro.build/guides/authoring-content/) |
| 44 | +- [Using Components](https://starlight.astro.build/components/using-components/) |
13 | 45 |
|
14 | | -> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! |
| 46 | +With the development server running (`pnpm dev`), your changes will be reflected immediately. |
15 | 47 |
|
16 | | -## 🚀 Project Structure |
| 48 | +## Prerequisites |
17 | 49 |
|
18 | | -Inside of your Astro + Starlight project, you'll see the following folders and files: |
| 50 | +- **Node.js:** Version 22.x (specified in `.nvmrc`, use [nvm](https://github.com/nvm-sh/nvm)) |
| 51 | +- **pnpm:** Version 10.2.0 or higher (`npm install -g pnpm`) |
| 52 | +- **Git:** For cloning the repository |
| 53 | + |
| 54 | +## Key Features |
| 55 | + |
| 56 | +- Multi-language support |
| 57 | +- Interactive components (GraphiQL editor, Testnet Faucet) |
| 58 | +- API Reference via OpenAPI specifications |
| 59 | +- Move Reference documentation |
| 60 | +- Search functionality (Algolia DocSearch) |
| 61 | +- Dynamic OG Images |
| 62 | + |
| 63 | +## Common Commands |
| 64 | + |
| 65 | +| Command | Description | |
| 66 | +| -------------- | ----------------------------- | |
| 67 | +| `pnpm dev` | Start the development server | |
| 68 | +| `pnpm build` | Build the site for production | |
| 69 | +| `pnpm preview` | Preview the production build | |
| 70 | +| `pnpm lint` | Check for linting issues | |
| 71 | +| `pnpm format` | Fix formatting issues | |
| 72 | + |
| 73 | +## Environment Variables |
| 74 | + |
| 75 | +Key environment variables: |
| 76 | + |
| 77 | +| Variable | Type | Purpose | Required? | |
| 78 | +| ----------------------- | ------ | ------------------------------ | ------------------------------------ | |
| 79 | +| `GITHUB_TOKEN` | Secret | Fetching Move Reference docs | Only if `ENABLE_MOVE_REFERENCE=true` | |
| 80 | +| `ENABLE_API_REFERENCE` | Public | Build REST API reference pages | Optional (default: `false`) | |
| 81 | +| `ENABLE_MOVE_REFERENCE` | Public | Build Move Reference docs | Optional (default: `false`) | |
| 82 | +| Firebase Credentials | Public | Authentication features | Required for Faucet/Auth | |
| 83 | +| Algolia Credentials | Public | Documentation search | Optional | |
| 84 | +| `GTAG_ID` | Public | Google Analytics tracking | Optional | |
| 85 | +| `OG_IMAGES_SECRET` | Secret | Dynamic OG image generation | Recommended for Vercel | |
| 86 | + |
| 87 | +## Project Structure |
19 | 88 |
|
20 | 89 | ``` |
21 | 90 | . |
22 | | -├── public/ |
| 91 | +├── config/ # Global sidebar configuration helper |
| 92 | +├── patches/ # Patched npm dependencies |
| 93 | +├── public/ # Static assets |
| 94 | +├── scripts/ # Utility scripts (Migration & Middleware generation) |
23 | 95 | ├── src/ |
24 | | -│ ├── assets/ |
25 | | -│ ├── content/ |
26 | | -│ │ ├── docs/ |
27 | | -│ └── content.config.ts |
28 | | -├── astro.config.mjs |
29 | | -├── package.json |
30 | | -├── tailwind.config.mjs |
31 | | -└── tsconfig.json |
| 96 | +│ ├── assets/ # Site assets |
| 97 | +│ ├── components/ # Reusable components |
| 98 | +│ ├── config/ # Configuration helpers (i18n, docSearch, sidebar) |
| 99 | +│ ├── content/ # Content Collections |
| 100 | +│ │ ├── docs/ # Main documentation content |
| 101 | +│ │ ├── i18n/ # UI translations |
| 102 | +│ │ └── nav/ # Sidebar translations |
| 103 | +│ ├── integrations/ # Custom integrations |
| 104 | +│ ├── lib/ # Utility functions |
| 105 | +│ ├── loaders/ # Content Collection loaders |
| 106 | +│ ├── middlewares/ # Edge Middleware |
| 107 | +│ ├── pages/ # Astro pages |
| 108 | +│ ├── plugins/ # Remark/Rehype plugins |
| 109 | +│ ├── starlight-overrides/ # Overridden components |
| 110 | +│ ├── stores/ # State management |
| 111 | +│ ├── styles/ # CSS styles |
| 112 | +│ └── utils/ # General utilities |
| 113 | +└── Various config files # Configuration files |
32 | 114 | ``` |
33 | 115 |
|
34 | | -Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. |
35 | | - |
36 | | -Images can be added to `src/assets/` and embedded in Markdown with a relative link. |
37 | | - |
38 | | -Static assets, like favicons, can be placed in the `public/` directory. |
| 116 | +## Configuration Files |
39 | 117 |
|
40 | | -## 🧞 Commands |
| 118 | +| File | Purpose | |
| 119 | +| ------------------ | -------------------------------- | |
| 120 | +| `.env.example` | Example environment variables | |
| 121 | +| `astro.config.mjs` | Main configuration | |
| 122 | +| `astro.sidebar.ts` | Documentation sidebar structure | |
| 123 | +| `package.json` | Project dependencies and scripts | |
41 | 124 |
|
42 | | -All commands are run from the root of the project, from a terminal: |
| 125 | +## Technologies Used |
43 | 126 |
|
44 | | -| Command | Action | |
45 | | -| :------------------------ | :----------------------------------------------- | |
46 | | -| `npm install` | Installs dependencies | |
47 | | -| `npm run dev` | Starts local dev server at `localhost:4321` | |
48 | | -| `npm run build` | Build your production site to `./dist/` | |
49 | | -| `npm run preview` | Preview your build locally, before deploying | |
50 | | -| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | |
51 | | -| `npm run astro -- --help` | Get help using the Astro CLI | |
| 127 | +| Category | Technology | Description | |
| 128 | +| ------------------- | --------------------------------------------------- | ------------------------------------------ | |
| 129 | +| **Framework** | [Astro](https://astro.build/) | Web framework for content-driven sites | |
| 130 | +| **Docs Framework** | [Starlight](https://starlight.astro.build/) | Documentation toolkit for Astro | |
| 131 | +| **Styling** | [Tailwind CSS](https://tailwindcss.com/) | Utility-first CSS framework | |
| 132 | +| **UI Components** | [React](https://react.dev/) | UI library (via Astro Islands) | |
| 133 | +| **Package Manager** | [pnpm](https://pnpm.io/) | Fast, disk space efficient package manager | |
| 134 | +| **Search** | [Algolia DocSearch](https://docsearch.algolia.com/) | Documentation search | |
| 135 | +| **Authentication** | [Firebase](https://firebase.google.com/) | Auth and backend services | |
| 136 | +| **Deployment** | [Vercel](https://vercel.com/) | Hosting platform | |
52 | 137 |
|
53 | | -## 👀 Want to learn more? |
| 138 | +## Contributing |
54 | 139 |
|
55 | | -Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). |
| 140 | +- Ensure code adheres to ESLint rules (`pnpm lint`) |
| 141 | +- Format code using Prettier (`pnpm format`) |
0 commit comments