Skip to content

ecom-co/template-docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Template Docs

A complete Docusaurus template configured according to the Vietnamese configuration checklist.

πŸ“ Features Included

βœ… 1. ThΓ΄ng tin cΖ‘ bαΊ£n (Basic Information)

  • title: My Project (configurable)
  • tagline: Docs powered by Docusaurus
  • favicon: img/favicon.ico

βœ… 2. ThΓ΄ng tin deploy (Deploy Information)

  • url: https://example.com (configurable)
  • baseUrl: /
  • organizationName: my-org (configurable)
  • projectName: my-docs (configurable)

βœ… 3. NgΓ΄n ngα»― (Internationalization)

  • defaultLocale: en
  • locales: ['en', 'vi'] - English and Vietnamese support

βœ… 4. Presets

  • 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)

βœ… 5. Navbar

  • title: My Project
  • logo: img/logo.svg
  • items: Docs, Blog, GitHub links + language dropdown

βœ… 6. Footer

  • style: dark
  • links: Three sections - Docs, Community, Resources
  • copyright: Copyright notice with current year

βœ… 7. Search (Enabled)

  • Algolia search configuration enabled and ready to use
  • Configure with your Algolia credentials to activate search functionality

βœ… 8. Sidebar (sidebars.ts)

  • Configured with Getting Started category
  • Manual sidebar structure defined

βœ… 9. Docs & Blog Content

  • docs/intro.md: Introduction documentation page
  • blog/hello.md: Sample blog post

πŸš€ Quick Start

  1. Clone and install dependencies:

    npm install
  2. Start development server:

    npm start
  3. Build for production:

    npm run build

βš™οΈ Customization Guide

Basic Configuration

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
}

Configure Algolia Search

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 New Languages

  1. Add locale to the i18n.locales array in docusaurus.config.ts
  2. Run npm run write-translations -- --locale [locale]
  3. Translate the generated files

Customize Sidebar

Edit sidebars.ts to modify the documentation structure:

const sidebars: SidebarsConfig = {
  tutorialSidebar: [
    'intro',
    {
      type: 'category', 
      label: 'Your Category',
      items: ['doc1', 'doc2'],
    },
  ],
};

πŸ“ Project Structure

β”œβ”€β”€ 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

πŸ› οΈ Available Scripts

  • npm start - Start development server
  • npm run build - Build for production
  • npm run serve - Serve built site locally
  • npm run deploy - Deploy to GitHub Pages
  • npm run clear - Clear cache
  • npm run write-translations - Generate translation files
  • npm run typecheck - Run TypeScript checks

πŸ“ Content Management

Adding Documentation

  1. Create .md files in the docs/ directory
  2. Add frontmatter for metadata:
    ---
    sidebar_position: 1
    title: Page Title
    ---

Adding Blog Posts

  1. Create .md files in the blog/ directory
  2. Use frontmatter for post metadata:
    ---
    title: Post Title
    authors: [author-key]
    tags: [tag1, tag2]
    ---

🌍 Internationalization

This template supports English (en) and Vietnamese (vi) by default. To add content in Vietnamese:

  1. Create i18n/vi/ directories for translations
  2. Add translated content files
  3. Use the language switcher in the navbar

πŸ“¦ Deployment

GitHub Pages

  1. Set repository settings in docusaurus.config.ts
  2. Run npm run deploy

Other Platforms

  1. Run npm run build
  2. Deploy the build/ directory to your hosting platform

πŸ”§ Development Tips

  • Use npm run start for live development with hot reload
  • Edit src/css/custom.css for custom styling
  • Add React components in src/components/
  • Test builds locally with npm run build && npm run serve

πŸ“š Documentation

Built with ❀️ using Docusaurus

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •