Skip to content

Getting Started

Welcome to the TechHub tech knowledge base! This guide will help you quickly understand the project structure, start the local development environment, and publish your first version of documentation.

Environment Requirements

  • Node.js 18 or above
  • Any package manager: npm / pnpm / yarn

Install Dependencies

bash
npm install

Start the Development Server

bash
npm run docs:dev

After starting, visit http://localhost:5173. Editing any Markdown file will give you live hot-reload preview.

Directory Structure

.
├── docs/
│   ├── .vitepress/          # VitePress configuration and theme
│   │   ├── config.mjs       # Global site configuration (nav/sidebar/search, etc.)
│   │   └── theme/           # Theme customization (styles, components)
│   ├── public/              # Static assets (images, favicon, etc.)
│   ├── index.md             # Home page
│   ├── project/             # Documentation for this site itself
│   ├── frontend/            # Frontend technologies
│   ├── backend/             # Backend technologies
│   ├── languages/           # Programming languages
│   ├── ai/                  # AI
│   ├── paths/               # Learning paths
│   ├── journals/            # Process journals (logs/pitfalls/retrospectives)
│   ├── books/               # Book notes
│   └── papers/              # Literature collection
├── scripts/                 # Deploy/rollback/changelog scripts
├── package.json
└── README.md

Add a New Document

  1. Create a .md file in the corresponding directory, e.g. docs/guide/example.md;
  2. Write the Frontmatter metadata at the top of the file:
md
---
title: 示例文档
description: 本文档用于演示基础用法。
---

# 示例文档

这里是正文内容。
  1. Add the page to the sidebar (edit the sidebar config in docs/.vitepress/config.mjs).

Build the Static Site

bash
npm run docs:build

The build output goes to docs/.vitepress/dist, which can be hosted on any static server or CDN.

Preview the Build Locally

bash
npm run docs:preview

Next Steps

  • To learn how to write richer documentation content, read the Writing Guide.
  • Ready to publish your docs online? Read Deployment.

Built with VitePress · Knowledge shared openly