Configuration
After setting up your Docsta project, a few simple configuration steps will help you connect your content source, customize layout behavior, and get everything working smoothly.
1. Environment Variables
Create a .env.local file in the root of your project and add the following values:
# .env.local
NEXT_PUBLIC_SANITY_PROJECT_ID=your_project_id
NEXT_PUBLIC_SANITY_DATASET=production
NEXT_PUBLIC_SANITY_API_VERSION=2023-01-01These variables tell your app how to connect to your Sanity project. You can find your Project ID and dataset in your Sanity.io dashboard.
2. Sanity Configuration (Optional)
If you're using Sanity for content management, make sure your sanity.config.ts looks like this:
// sanity/sanity.config.ts
import { defineConfig } from 'sanity'
import schemas from './schemas'
export default defineConfig({
projectId: process.env.NEXT_PUBLIC_SANITY_PROJECT_ID,
dataset: process.env.NEXT_PUBLIC_SANITY_DATASET,
apiVersion: process.env.NEXT_PUBLIC_SANITY_API_VERSION,
title: 'Docsta Docs',
basePath: '/studio',
schema: {
types: schemas,
},
})
npx sanity dev3. Next.js Configuration
Ensure your next.config.js includes any necessary settings, such as image domains or experimental features:
// next.config.js
const nextConfig = {
reactStrictMode: true,
images: {
domains: ['cdn.sanity.io'],
},
}
module.exports = nextConfig4. Tailwind CSS (If applicable)
If youβre using Tailwind CSS (recommended), verify your tailwind.config.js includes the right content paths:
// tailwind.config.js
module.exports = {
content: [
'./app/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
'./lib/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
}5. Customization
You can modify layout components in the components/ directory (like Layout.tsx or Sidebar.tsx) to match your branding and navigation logic.
With these settings in place, your Docsta-powered documentation site is fully configured and ready to build!
π Next Up: Start writing your docs with Markdown or through Sanity Studio.
What did you think of this content?
It was helpful
It was not helpful
I have a feedback