|
1 |
| -# Tina Starter 🦙 |
| 1 | +# 🚀 TinaDocs - Your Complete Documentation Solution |
2 | 2 |
|
3 |
| - |
| 3 | +> **Modern documentation made simple and powerful** |
4 | 4 |
|
5 |
| -This Next.js starter is powered by [TinaCMS](https://app.tina.io) for you and your team to visually live edit the structured content of your website. ✨ |
| 5 | +TinaDocs is a complete documentation solution built with [Tina CMS](https://tina.io/) that combines developer-friendly tools with content creator accessibility. |
6 | 6 |
|
7 |
| -The content is managed through Markdown and JSON files stored in your GitHub repository, and queried through Tina GraphQL API. |
| 7 | + |
| 8 | +**Figure: Landing Page of TinaDocs** |
8 | 9 |
|
9 |
| -### Features |
| 10 | +## ✨ Why Choose TinaDocs |
10 | 11 |
|
11 |
| -- [Tina Headless CMS](https://app.tina.io) for authentication, content modeling, visual editing and team management. |
12 |
| -- [Vercel](https://vercel.com) deployment to visually edit your site from the `/admin` route. |
13 |
| -- Local development workflow from the filesystem with a local GraqhQL server. |
| 12 | +### **Rich Feature Set** |
| 13 | +- **🔍 Fast search** - Powered by Pagefind for instant content discovery |
| 14 | +- **📊 API documentation** - Generate beautiful API docs from your OpenAPI specs |
| 15 | +- **📑 Multi-tab interfaces** - Organize complex information with tabbed layouts |
| 16 | +- **🎨 Custom theming** - Make your docs match your brand |
| 17 | +- **✏️ Visual editing** - Content creators can edit directly through TinaCMS |
| 18 | +- **📱 Responsive design** - Works great on all devices |
| 19 | +- **⚡ Performance optimized** - Built with Next.js for fast load times |
14 | 20 |
|
15 |
| -## Requirements |
| 21 | +### **What Makes It Special** |
| 22 | +- **Modern stack** - Clean, maintainable codebase |
| 23 | +- **Developer-friendly** - Easy to customize and extend |
| 24 | +- **Content creator-friendly** - Non-technical team members can contribute |
| 25 | +- **SEO optimized** - Built-in best practices for search visibility |
16 | 26 |
|
17 |
| -- Git, [Node.js Active LTS](https://nodejs.org/en/about/releases/), pnpm installed for local development. |
18 |
| -- A [TinaCMS](https://app.tina.io) account for live editing. |
| 27 | +--- |
19 | 28 |
|
20 |
| -## Local Development |
| 29 | +## 🚀 Quick Start with npx |
21 | 30 |
|
22 |
| -Install the project's dependencies: |
| 31 | +The fastest way to get started with TinaDocs is using npx: |
23 | 32 |
|
24 |
| -> [!NOTE] |
25 |
| -> [Do you know the best package manager for Node.js?](https://www.ssw.com.au/rules/best-package-manager-for-node/) Using the right package manager can greatly enhance your development workflow. We recommend using pnpm for its speed and efficient handling of dependencies. Learn more about why pnpm might be the best choice for your projects by checking out this rule from SSW. |
| 33 | +```bash |
| 34 | +npx {{ TODO }} my-docs --template tinadocs |
| 35 | +``` |
26 | 36 |
|
| 37 | +This command will: |
| 38 | +- Download and set up TinaDocs in a new directory called `my-docs` |
| 39 | +- Prompt you to select your preferred theme during setup |
| 40 | +- Configure the basic project structure |
| 41 | +- Install all necessary dependencies |
27 | 42 |
|
28 |
| -``` |
| 43 | +### **Available Themes** |
| 44 | + |
| 45 | +When using npx, you can choose from these beautiful themes: |
| 46 | + |
| 47 | +- **Default** - Clean black and white design |
| 48 | +- **Tina** - TinaCMS-inspired theme with orange accents |
| 49 | +- **Blossom** - Elegant pink/rose color scheme |
| 50 | +- **Lake** - Professional blue color palette |
| 51 | +- **Pine** - Natural green tones |
| 52 | +- **Indigo** - Modern purple/indigo design |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## 📖 How to Use TinaDocs |
| 57 | + |
| 58 | +There are two ways you can use TinaDocs: |
| 59 | + |
| 60 | +• **For developers** – as a launching point to develops a highly custom docs solution. TinaCMS is based on markdown. Use this code as a basis to [implement custom components](https://tina.io/docs/reference/types/rendering-markdown#linking-to-react-components) to be used in MDX to fit your use case. Follow the Getting Started guide below. |
| 61 | + |
| 62 | +• **Quickest experience** – use as is and deploy in minutes via TinaCloud for a docs setup that you still hold all the keys and data for, and get to using right away. |
| 63 | + |
| 64 | + |
| 65 | +> 💡 TinaCMS integrates tighly with GitHub, and has a powerful [editorial workflow](https://tina.io/docs/tina-cloud/editorial-workflow) based on GitHub's branch protection features. |
| 66 | +
|
| 67 | +## 🛠️ Getting Started |
| 68 | + |
| 69 | +### **Step 1: Install Dependencies** |
| 70 | + |
| 71 | +> 💡 We recommend `pnpm` for faster installs. [Learn why pnpm is great](https://www.ssw.com.au/rules/best-package-manager-for-node/) for Node.js projects. |
| 72 | +
|
| 73 | +```bash |
29 | 74 | pnpm install
|
30 | 75 | ```
|
31 | 76 |
|
32 |
| -Run the project locally: |
| 77 | +### **Step 2: Start Development Server** |
33 | 78 |
|
34 |
| -``` |
| 79 | +```bash |
35 | 80 | pnpm dev
|
36 | 81 | ```
|
37 | 82 |
|
38 |
| -### Local URLs |
| 83 | +Open [http://localhost:3000](http://localhost:3000) to see your docs in action. |
39 | 84 |
|
40 |
| -- http://localhost:3000 : browse the website |
41 |
| -- http://localhost:3000/admin : connect to Tina Cloud and go in edit mode |
42 |
| -- http://localhost:3000/exit-admin : log out of Tina Cloud |
43 |
| -- http://localhost:4001/altair/ : GraphQL playground to test queries and browse the API documentation |
| 85 | +--- |
44 | 86 |
|
45 |
| -## Deployment |
| 87 | +## 🌐 Production Setup |
46 | 88 |
|
47 |
| -### GitHub Pages |
| 89 | +### **Step 3: Set Up GitHub and TinaCloud** |
48 | 90 |
|
49 |
| -This starter can be deployed to GitHub Pages. A GitHub Actions workflow is included that handles the build and deployment process. |
| 91 | +1. **Add your docs to GitHub**: Push your local repository to GitHub if you haven't already |
| 92 | +2. **Create a TinaCloud account**: Sign up at [app.tina.io](https://app.tina.io) |
| 93 | +3. **Link your repository**: Connect your GitHub repository to TinaCloud through the dashboard |
50 | 94 |
|
51 |
| -To deploy to GitHub Pages: |
| 95 | +### **Step 4: Configure Environment** |
52 | 96 |
|
53 |
| -1. In your repository settings, ensure GitHub Pages is enabled and set to deploy from the `gh-pages` branch |
54 |
| -2. Push changes to your main branch - the workflow will automatically build and deploy the site |
| 97 | +1. Rename `.env.example` to `.env` |
| 98 | +2. Add your Tina credentials: |
55 | 99 |
|
56 |
| -> [!NOTE] |
57 |
| -> When deploying to GitHub Pages, you'll need to update your secrets in Settings | Secrets and variables | Actions to include: |
58 |
| -> - `NEXT_PUBLIC_TINA_CLIENT_ID` |
59 |
| -> - `TINA_TOKEN` |
60 |
| -> |
61 |
| -> You get these from your TinaCloud project - [read the docs](https://tina.io/docs/tina-cloud/deployment-options/github-pages) |
| 100 | +```env |
| 101 | +NEXT_PUBLIC_TINA_CLIENT_ID=<get this from app.tina.io> |
| 102 | +TINA_TOKEN=<get this from app.tina.io> |
| 103 | +NEXT_PUBLIC_TINA_BRANCH=<your content branch> |
| 104 | +NEXT_PUBLIC_ENABLE_THEME_SELECTION=<dispaly theme selector> |
| 105 | +``` |
62 | 106 |
|
63 |
| -> [!IMPORTANT] |
64 |
| -> GitHub Pages does not support server side code, so this will run as a static site. If you don't want to deploy to GitHub pages, just delete `.github/workflows/build-and-deploy.yml` |
| 107 | +**Theme Preview Mode:** |
| 108 | +To enable a theme selector in the UI for previewing all themes, add: |
| 109 | +```env |
| 110 | +NEXT_PUBLIC_ENABLE_THEME_SELECTION=true |
| 111 | +``` |
65 | 112 |
|
66 |
| -### Building the Starter Locally (Using the hosted content API) |
| 113 | +> 💡 **Note:** The theme selector allows you to preview different themes in real-time, but these changes are temporary and won't persist when you open a new browser window/tab. To make a theme permanent, update the `Selected Them` field in your Settings through TinaCMS. |
67 | 114 |
|
68 |
| -Replace the `.env.example`, with `.env` |
| 115 | +### **Step 5: Build for Production** |
69 | 116 |
|
| 117 | +```bash |
| 118 | +pnpm build |
70 | 119 | ```
|
71 |
| -NEXT_PUBLIC_TINA_CLIENT_ID=<get this from the project you create at app.tina.io> |
72 |
| -TINA_TOKEN=<get this from the project you create at app.tina.io> |
73 |
| -NEXT_PUBLIC_TINA_BRANCH=<Specify the branch with Tina configured> |
74 |
| -``` |
75 | 120 |
|
76 |
| -Build the project: |
| 121 | +--- |
| 122 | + |
| 123 | +## 🚀 Deployment |
| 124 | + |
| 125 | +### **Step 6: Deploy to Vercel** |
| 126 | + |
| 127 | +TinaDocs works great with Vercel. Check out our [deployment guide](https://tina.io/docs/tina-cloud/deployment-options/vercel) for detailed instructions. |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## 🔍 Search Setup |
| 132 | + |
| 133 | +TinaDocs includes fast search powered by [Pagefind](https://pagefind.app/), which indexes your content during the build process. |
| 134 | + |
| 135 | +### **How to Build the Search Index** |
| 136 | + |
| 137 | +To generate or update the search index, run: |
| 138 | + |
77 | 139 |
|
78 | 140 | ```bash
|
79 |
| -pnpm build |
| 141 | +pnpm build-local-pagefind |
80 | 142 | ```
|
| 143 | +This command: |
81 | 144 |
|
82 |
| -## Getting Help |
83 |
| - |
84 |
| -To get help with any TinaCMS challenges you may have: |
| 145 | +- Builds the project |
85 | 146 |
|
86 |
| -- Visit the [documentation](https://tina.io/docs/) to learn about Tina. |
87 |
| -- [Join our Discord](https://discord.gg/zumN63Ybpf) to share feedback. |
88 |
| -- Visit the [community forum](https://community.tinacms.org/) to ask questions. |
89 |
| -- Get support through the chat widget on the TinaCMS Dashboard |
90 |
| -- [Email us ](mailto:[email protected]) to schedule a call with our team and share more about your context and what you're trying to achieve. |
91 |
| -- [Search or open an issue](https://github.com/tinacms/tinacms/issues) if something is not working. |
92 |
| -- Reach out on Twitter at [@tina_cms](https://twitter.com/tina_cms). |
| 147 | +- Generates the search index |
93 | 148 |
|
94 |
| -## Development tips |
| 149 | +- Saves the index files to `public/pagefind/` |
95 | 150 |
|
96 |
| -### Visual Studio Code GraphQL extension |
| 151 | +The search index is automatically updated every time you run the build. |
97 | 152 |
|
98 |
| -[Install the GraphQL extension](https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql) to benefit from type auto-completion. |
| 153 | +--- |
99 | 154 |
|
100 |
| -### Typescript |
| 155 | +## 📚 Learn More |
101 | 156 |
|
102 |
| -A good way to ensure your components match the shape of your data is to leverage the auto-generated TypeScript types. |
103 |
| -These are rebuilt when your `tina` config changes. |
| 157 | +- [Tina Documentation](https://tina.io/docs) - Explore Tina's full capabilities |
| 158 | +- [Getting Started Guide](https://tina.io/docs/setup-overview/) - Quick setup walkthrough |
| 159 | +- [GitHub Repository](https://github.com/tinacms/tinacms) - Contribute or report issues |
104 | 160 |
|
105 |
| -## LICENSE |
| 161 | +--- |
106 | 162 |
|
107 |
| -Licensed under the [Apache 2.0 license](./LICENSE). |
| 163 | +**Ready to improve your documentation?** Give TinaDocs a try! |
0 commit comments