Global Configuration
DocKit bietet flexible globale Konfigurationsoptionen, um das Erscheinungsbild, das Verhalten und die Funktionalität Ihrer Dokumentationsseite anzupassen. In dieser Anleitung werden alle wesentlichen Einstellungen behandelt, die Sie konfigurieren können.
Configuration Files
Section titled “Configuration Files”DocKit verwendet mehrere Konfigurationsdateien, die sich im Verzeichnis src/config/ befinden:
src/config/├── config.json # Main site configuration├── theme.json # Theme and styling options├── menu.json # Navigation menu structure├── social.json # Social media links└── locals.json # Localization settingsMain Configuration (config.json)
Section titled “Main Configuration (config.json)”Die Hauptkonfigurationsdatei steuert die Grundeinstellungen Ihrer Site:
{ "site": { "title": "DocKit Documentation", "description": "Beautiful documentation made simple", "author": "Your Name", "email": "your.email@example.com", "base_url": "https://yourdomain.com" }, "metadata": { "meta_author": "DocKit Team", "meta_image": "/images/og-image.png", "meta_description": "Create beautiful documentation with DocKit" }}Configuration Options
Section titled “Configuration Options”| Option | Type | Description |
|---|---|---|
site.title |
Zeichenfolge | Der Haupttitel Ihrer Website |
site.description |
Zeichenfolge | Kurze Beschreibung Ihrer Dokumentation |
site.author |
String | Default author name |
site.email |
String | Contact email address |
site.base_url |
Zeichenfolge | Die Produktions-URL Ihrer Website |
metadata.meta_image |
String | Default Open Graph image |
Theme Configuration (theme.json)
Section titled “Theme Configuration (theme.json)”Passen Sie das visuelle Erscheinungsbild Ihrer Website an:
{ "theme": { "primary_color": "#2563eb", "secondary_color": "#64748b", "accent_color": "#06b6d4", "background_color": "#ffffff", "text_color": "#1e293b" }, "layout": { "sidebar_width": "280px", "content_max_width": "1200px", "enable_breadcrumbs": true, "enable_toc": true }, "features": { "dark_mode": true, "search": true, "print_button": true, "edit_page": true }}Theme Options
Section titled “Theme Options”Colors
Section titled “Colors”primary_color: Hauptmarkenfarbe für Links und Schaltflächensecondary_color: Sekundäre Elemente und Ränderaccent_color: Highlights und Call-to-Action-Elementebackground_color: Main background colortext_color: Default text color
Layout
Section titled “Layout”sidebar_width: Breite der Navigationsseitenleistecontent_max_width: Maximum width of content areaenable_breadcrumbs: Show/hide breadcrumb navigationenable_toc: Show/hide table of contents
Features
Section titled “Features”dark_mode: Enable dark mode togglesearch: Enable site search functionalityprint_button: Show print button on pagesedit_page: Links „Diese Seite bearbeiten“ anzeigen
Navigation Menu (menu.json)
Section titled “Navigation Menu (menu.json)”Definieren Sie die Navigationsstruktur Ihrer Website:
{ "main": [ { "name": "Getting Started", "url": "/getting-started/", "children": [ { "name": "Introduction", "url": "/getting-started/introduction/" }, { "name": "Global Settings", "url": "/getting-started/global-settings/" } ] }, { "name": "Guides", "url": "/guides/" }, { "name": "Reference", "url": "/reference/" } ]}Social Links (social.json)
Section titled “Social Links (social.json)”Konfigurieren Sie soziale Medien und externe Links:
{ "social": [ { "name": "GitHub", "icon": "github", "url": "https://github.com/yourusername/your-repo" }, { "name": "Twitter", "icon": "twitter", "url": "https://twitter.com/yourusername" }, { "name": "Discord", "icon": "discord", "url": "https://discord.gg/your-server" } ]}Localization (locals.json)
Section titled “Localization (locals.json)”Set up multi-language support:
{ "defaultLocale": "en", "locales": { "en": { "label": "English", "lang": "en", "dir": "ltr" }, "de": { "label": "Deutsch", "lang": "de", "dir": "ltr" } }}Astro Configuration
Section titled “Astro Configuration”DocKit lässt sich auch in die Konfiguration von Astro in astro.config.mjs integrieren:
import { defineConfig } from 'astro/config';import starlight from '@astrojs/starlight';
export default defineConfig({ integrations: [ starlight({ title: 'DocKit', description: 'Beautiful documentation made simple', logo: { src: './src/assets/logo.svg', }, customCss: [ './src/styles/global.css', ], }), ],});Environment Variables
Section titled “Environment Variables”Configure environment-specific settings using .env files:
PUBLIC_SITE_URL=http://localhost:4321PUBLIC_ANALYTICS_ID=your-analytics-idGITHUB_TOKEN=your-github-tokenBest Practices
Section titled “Best Practices”Performance
Section titled “Performance”- Halten Sie die Konfigurationsdateien klein und fokussiert
- Use appropriate data types (strings, booleans, numbers)
- Avoid deeply nested structures
Maintenance
Section titled “Maintenance”- Dokumentieren Sie Ihre benutzerdefinierten Konfigurationen
- Verwenden Sie die Versionskontrolle für Konfigurationsänderungen
- Test configuration changes in development first
Security
Section titled “Security”- Never commit sensitive data to configuration files
- Verwenden Sie Umgebungsvariablen für Geheimnisse
- Validate configuration inputs
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Konfiguration wird nicht geladen: Stellen Sie sicher, dass JSON-Dateien eine gültige Syntax und die richtigen Dateierweiterungen haben.
Stile gelten nicht: Überprüfen Sie, ob die theme.json-Werte eine gültige CSS-Syntax verwenden.
Menü wird nicht angezeigt: Überprüfen Sie, ob die Struktur von menu.json dem erwarteten Format entspricht.
Build errors: Validate all configuration files against their schemas.
Benötigen Sie Hilfe bei der erweiterten Konfiguration? Schauen Sie sich unser customization guide an oder fragen Sie in unserem community discussions.
