A complete Docusaurus template configured according to the Vietnamese configuration checklist.
- title: My Project (configurable)
- tagline: Docs powered by Docusaurus
- favicon: img/favicon.ico
- url: https://example.com (configurable)
- baseUrl: /
- organizationName: my-org (configurable)
- projectName: my-docs (configurable)
- defaultLocale: en
- locales: ['en', 'vi'] - English and Vietnamese support
- Docs:
- sidebarPath pointing to sidebars.ts
- routeBasePath set to /docs
- Blog: Fully configured with reading time, RSS feeds
- Theme: Custom CSS support (src/css/custom.css)
- title: My Project
- logo: img/logo.svg
- items: Docs, Blog, GitHub links + language dropdown
- style: dark
- links: Three sections - Docs, Community, Resources
- copyright: Copyright notice with current year
- Algolia search configuration enabled and ready to use
- Configure with your Algolia credentials to activate search functionality
- Configured with Getting Started category
- Manual sidebar structure defined
- docs/intro.md: Introduction documentation page
- blog/hello.md: Sample blog post
-
Clone and install dependencies:
npm install
-
Start development server:
npm start
-
Build for production:
npm run build
Edit docusaurus.config.ts to customize:
const config: Config = {
title: 'Your Project Name',
tagline: 'Your tagline here',
url: 'https://yourdomain.com',
baseUrl: '/',
organizationName: 'your-org',
projectName: 'your-repo-name',
// ... other settings
}The Algolia search has been enabled in docusaurus.config.ts. To use it with your own search index, update the configuration:
algolia: {
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_SEARCH_API_KEY',
indexName: 'YOUR_INDEX_NAME',
contextualSearch: true,
},Replace the placeholder values with your actual Algolia credentials.
- Add locale to the
i18n.localesarray indocusaurus.config.ts - Run
npm run write-translations -- --locale [locale] - Translate the generated files
Edit sidebars.ts to modify the documentation structure:
const sidebars: SidebarsConfig = {
tutorialSidebar: [
'intro',
{
type: 'category',
label: 'Your Category',
items: ['doc1', 'doc2'],
},
],
};βββ blog/ # Blog posts
βββ docs/ # Documentation files
βββ src/
β βββ components/ # React components
β βββ css/ # Custom CSS
β βββ pages/ # Custom pages
βββ static/ # Static assets (images, etc.)
βββ docusaurus.config.ts # Main configuration
βββ sidebars.ts # Sidebar configuration
βββ package.json
npm start- Start development servernpm run build- Build for productionnpm run serve- Serve built site locallynpm run deploy- Deploy to GitHub Pagesnpm run clear- Clear cachenpm run write-translations- Generate translation filesnpm run typecheck- Run TypeScript checks
- Create
.mdfiles in thedocs/directory - Add frontmatter for metadata:
--- sidebar_position: 1 title: Page Title ---
- Create
.mdfiles in theblog/directory - Use frontmatter for post metadata:
--- title: Post Title authors: [author-key] tags: [tag1, tag2] ---
This template supports English (en) and Vietnamese (vi) by default. To add content in Vietnamese:
- Create
i18n/vi/directories for translations - Add translated content files
- Use the language switcher in the navbar
- Set repository settings in
docusaurus.config.ts - Run
npm run deploy
- Run
npm run build - Deploy the
build/directory to your hosting platform
- Use
npm run startfor live development with hot reload - Edit
src/css/custom.cssfor custom styling - Add React components in
src/components/ - Test builds locally with
npm run build && npm run serve
Built with β€οΈ using Docusaurus